Skip to content

Commit

Permalink
feat: Set up eslint-plugin-react-compiler to throw errors if React ru…
Browse files Browse the repository at this point in the history
…les are violated.

	check facebook/react#29093
  • Loading branch information
Your Name committed Jul 4, 2024
1 parent 4b72fb0 commit 63ebf27
Show file tree
Hide file tree
Showing 3 changed files with 128 additions and 1 deletion.
3 changes: 2 additions & 1 deletion vite-project/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ module.exports = {
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
plugins: ['react-refresh','react-compiler'],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
'react-compiler/react-compiler': 'error'
},
}
1 change: 1 addition & 0 deletions vite-project/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"@typescript-eslint/parser": "^7.13.1",
"@vitejs/plugin-react": "^4.3.1",
"eslint": "^8.57.0",
"eslint-plugin-react-compiler": "0.0.0-experimental-0998c1e-20240625",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.7",
"typescript": "^5.2.2",
Expand Down
125 changes: 125 additions & 0 deletions vite-project/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 63ebf27

Please sign in to comment.