Skip to content

Commit

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

Signed-off-by: Jon Koops <[email protected]>
  • Loading branch information
jonkoops committed Oct 26, 2024
1 parent 96e94df commit 4bcc4f9
Show file tree
Hide file tree
Showing 3 changed files with 367 additions and 1 deletion.
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 @@ -26,7 +27,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 @@ -118,6 +120,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.36.1",
"eslint-plugin-react-compiler": "19.0.0-beta-8a03594-20241020",
"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 4bcc4f9

Please sign in to comment.