Skip to content

Commit ccf0c2d

Browse files
committed
Replace react-compiler ESLint rules with react-hooks rules
1 parent 193326d commit ccf0c2d

File tree

1 file changed

+32
-4
lines changed

1 file changed

+32
-4
lines changed

.eslintrc.js

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,11 +320,25 @@ module.exports = {
320320
jsx: true,
321321
},
322322
},
323-
plugins: ['react', 'react-hooks', 'react-compiler'],
323+
plugins: ['react', 'react-hooks'],
324324
rules: {
325325
'react-hooks/rules-of-hooks': 'error',
326326
'react-hooks/exhaustive-deps': 'warn',
327-
'react-compiler/react-compiler': 'error',
327+
'react-hooks/component-hook-factories': 'error', // Validates higher order functions defining nested components or hooks
328+
'react-hooks/config': 'error', // Validates the compiler configuration options
329+
'react-hooks/error-boundaries': 'error', // Validates usage of Error Boundaries instead of try/catch for child errors
330+
'react-hooks/gating': 'error', // Validates configuration of gating mode
331+
'react-hooks/globals': 'error', // Validates against assignment/mutation of globals during render
332+
'react-hooks/immutability': 'error', // Validates against mutating props, state, and other immutable values
333+
'react-hooks/incompatible-library': 'error', // Validates against usage of libraries which are incompatible with memoization
334+
'react-hooks/preserve-manual-memoization': 'error', // Validates that existing manual memoization is preserved by the compiler
335+
'react-hooks/purity': 'error', // Validates that components/hooks are pure by checking known-impure functions
336+
'react-hooks/refs': 'error', // Validates correct usage of refs, not reading/writing during render
337+
'react-hooks/set-state-in-effect': 'error', // Validates against calling setState synchronously in an effect
338+
'react-hooks/set-state-in-render': 'error', // Validates against setting state during render
339+
'react-hooks/static-components': 'error', // Validates that components are static, not recreated every render
340+
'react-hooks/unsupported-syntax': 'error', // Validates against syntax that React Compiler does not support
341+
'react-hooks/use-memo': 'error', // Validates usage of the useMemo hook without a return value
328342
'react/no-unused-prop-types': 'error',
329343
'react/no-unused-state': 'error',
330344
'react/jsx-boolean-value': 'error',
@@ -365,11 +379,25 @@ module.exports = {
365379
jsx: true,
366380
},
367381
},
368-
plugins: ['react', 'react-hooks', 'react-compiler'],
382+
plugins: ['react', 'react-hooks'],
369383
rules: {
370384
'react-hooks/rules-of-hooks': 'error',
371385
'react-hooks/exhaustive-deps': 'warn',
372-
'react-compiler/react-compiler': 'error',
386+
'react-hooks/component-hook-factories': 'error', // Validates higher order functions defining nested components or hooks
387+
'react-hooks/config': 'error', // Validates the compiler configuration options
388+
'react-hooks/error-boundaries': 'error', // Validates usage of Error Boundaries instead of try/catch for child errors
389+
'react-hooks/gating': 'error', // Validates configuration of gating mode
390+
'react-hooks/globals': 'error', // Validates against assignment/mutation of globals during render
391+
'react-hooks/immutability': 'error', // Validates against mutating props, state, and other immutable values
392+
'react-hooks/incompatible-library': 'error', // Validates against usage of libraries which are incompatible with memoization
393+
'react-hooks/preserve-manual-memoization': 'error', // Validates that existing manual memoization is preserved by the compiler
394+
'react-hooks/purity': 'error', // Validates that components/hooks are pure by checking known-impure functions
395+
'react-hooks/refs': 'error', // Validates correct usage of refs, not reading/writing during render
396+
'react-hooks/set-state-in-effect': 'error', // Validates against calling setState synchronously in an effect
397+
'react-hooks/set-state-in-render': 'error', // Validates against setting state during render
398+
'react-hooks/static-components': 'error', // Validates that components are static, not recreated every render
399+
'react-hooks/unsupported-syntax': 'error', // Validates against syntax that React Compiler does not support
400+
'react-hooks/use-memo': 'error', // Validates usage of the useMemo hook without a return value
373401
'react/no-unused-prop-types': 'warn',
374402
'react/no-unused-state': 'warn',
375403
'react/jsx-boolean-value': 'off',

0 commit comments

Comments
 (0)