Skip to content

Commit

Permalink
Ignore more file extensions in the eslint plugin
Browse files Browse the repository at this point in the history
Close #60
  • Loading branch information
javascripter authored and necolas committed Mar 25, 2024
1 parent 1bb9c55 commit 9295950
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/eslint-plugin/src/valid-styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import type {
SpreadElement
} from 'estree';

// Ignore .web.js files since they indicate web usage only
const ALLOWED_FILE = '.web.js';
// List of web-specific file extensions to ignore since they indicate web usage only
const ALLOWED_FILES = ['.web.js', '.web.jsx', '.web.ts', '.web.tsx'];

const allowlistedStylexProps = new Set([
'alignContent',
Expand Down Expand Up @@ -232,7 +232,11 @@ const rule: RuleModule = {
}
},
create(context: RuleContext) {
if (context.getFilename().endsWith(ALLOWED_FILE)) {
if (
ALLOWED_FILES.some((allowedFile) =>
context.getFilename().endsWith(allowedFile)
)
) {
return {};
}

Expand Down

0 comments on commit 9295950

Please sign in to comment.