Skip to content

Commit f9ca602

Browse files
amir-rahmaniiASafaeirad
authored andcommitted
fix(react): add languageOptions to predicate
1 parent 6b7e5fd commit f9ca602

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/modules/react.mjs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import reactPlugin from '@eslint-react/eslint-plugin';
22
import a11yPlugin from 'eslint-plugin-jsx-a11y';
33
import hooksPlugin from 'eslint-plugin-react-hooks';
4+
import { parser } from 'typescript-eslint';
45

56
import { predicate } from '../utils/conditions.mjs';
7+
import { globs } from '../utils/globs.mjs';
68

79
/** @return { import('eslint').Linter.Config } */
810
function react(options = {}) {
@@ -14,6 +16,13 @@ function react(options = {}) {
1416
'react-hooks': hooksPlugin,
1517
'jsx-a11y': a11yPlugin,
1618
},
19+
...predicate(projectService, {
20+
languageOptions: {
21+
parser,
22+
parserOptions: { ...options.typescript },
23+
},
24+
ignores: [globs.js, globs.jsx],
25+
}),
1726
settings: {
1827
'react': {
1928
pragma: 'React',

0 commit comments

Comments
 (0)