Skip to content

Commit 445cd8b

Browse files
committed
fix(react): add support for JSX runtime in ESLint configuration
- Enhanced the ESLint configuration to conditionally include rules and parser options for projects using the JSX runtime. - This update improves compatibility with React projects that leverage the new JSX transform.
1 parent 1b3b7f8 commit 445cd8b

File tree

1 file changed

+3
-0
lines changed
  • packages/eslint-config/src/config/plugins

1 file changed

+3
-0
lines changed

packages/eslint-config/src/config/plugins/react.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,6 +1029,8 @@ export default createConfig<
10291029

10301030
...pluginReactYouMightNotNeedAnEffect?.configs?.recommended?.rules,
10311031

1032+
...hasJsxRuntime ? pluginReact?.configs?.flat?.["jsx-runtime"]?.rules : {},
1033+
10321034
...prettier
10331035
? {
10341036
"react/jsx-child-element-spacing": "off",
@@ -1081,6 +1083,7 @@ export default createConfig<
10811083
jsx: true,
10821084
},
10831085
},
1086+
...hasJsxRuntime ? pluginReact?.configs?.flat?.["jsx-runtime"]?.languageOptions?.parserOptions : {},
10841087
},
10851088
name: "anolilab/react/jsx",
10861089
rules: {

0 commit comments

Comments
 (0)