Skip to content

Commit

Permalink
Add the React Compiler linter
Browse files Browse the repository at this point in the history
Closes #11137

Signed-off-by: Jon Koops <jonkoops@gmail.com>
  • Loading branch information
jonkoops committed Nov 8, 2024
1 parent a382cd6 commit 22d4376
Show file tree
Hide file tree
Showing 3 changed files with 362 additions and 3 deletions.
5 changes: 4 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { fixupPluginRules } from '@eslint/compat';
import js from '@eslint/js';
import patternflyReact from 'eslint-plugin-patternfly-react';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
import reactCompiler from 'eslint-plugin-react-compiler';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRecommended from 'eslint-plugin-react/configs/recommended.js';
import testingLibrary from 'eslint-plugin-testing-library';
Expand All @@ -27,7 +28,8 @@ export default [
{
plugins: {
'patternfly-react': fixupPluginRules(patternflyReact),
'react-hooks': fixupPluginRules(reactHooks)
'react-hooks': fixupPluginRules(reactHooks),
'react-compiler': reactCompiler
},
languageOptions: {
globals: {
Expand Down Expand Up @@ -119,6 +121,7 @@ export default [
radix: ['error', 'as-needed'],
'react/prop-types': 0,
'react/display-name': 0,
'react-compiler/react-compiler': 'warn',
'react-hooks/exhaustive-deps': 'warn',
'react/no-unescaped-entities': ['error', { forbid: ['>', '}'] }],
'spaced-comment': 'error',
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"eslint-plugin-markdown": "^5.1.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-compiler": "19.0.0-beta-63b359f-20241101",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-testing-library": "^6.3.0",
"fs-extra": "^11.2.0",
Expand Down
Loading

0 comments on commit 22d4376

Please sign in to comment.