Skip to content

Commit

Permalink
feat(eslint-config-smarthr): react 17+以降のルールに対応した
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroki0525 committed Jan 29, 2025
1 parent aa30e76 commit f62a940
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
7 changes: 6 additions & 1 deletion packages/eslint-config-smarthr/configs/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ export default [
languageOptions: {
parserOptions: {
ecmaFeatures: {
jax: true,
jsx: true,
},
// https://github.com/jsx-eslint/eslint-plugin-react/blob/e6b5b41191690ee166d0cca1e9db27092b910f03/index.js#L86
jsxPragma: null, // for @typescript/eslint-parser
},
},
settings: {
Expand Down Expand Up @@ -82,6 +84,9 @@ export default [
'react/prop-types': 'off',
'react/style-prop-object': 'error',
'react/void-dom-elements-no-children': 'error',
// https://github.com/jsx-eslint/eslint-plugin-react/blob/e6b5b41191690ee166d0cca1e9db27092b910f03/index.js#L89
'react/react-in-jsx-scope': 'off',
'react/jsx-uses-react': 'off'
}
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -1193,10 +1193,10 @@ exports[`should match ESLint Configuration snapshot 1`] = `
"parser": "typescript-eslint/[email protected]",
"parserOptions": {
"ecmaFeatures": {
"jax": true,
"jsx": true,
},
"ecmaVersion": 2018,
"jsxPragma": null,
"sourceType": "module",
},
"sourceType": "module",
Expand Down Expand Up @@ -2212,7 +2212,7 @@ exports[`should match ESLint Configuration snapshot 1`] = `
0,
],
"react/jsx-uses-react": [
2,
0,
],
"react/jsx-uses-vars": [
2,
Expand Down Expand Up @@ -2287,7 +2287,7 @@ exports[`should match ESLint Configuration snapshot 1`] = `
0,
],
"react/react-in-jsx-scope": [
2,
0,
],
"react/require-render-return": [
2,
Expand Down

0 comments on commit f62a940

Please sign in to comment.