31 lines
843 B
JavaScript
31 lines
843 B
JavaScript
import reactPlugin from 'eslint-plugin-react';
|
|
import compilerPlugin from 'eslint-plugin-react-compiler';
|
|
import hooksPlugin from 'eslint-plugin-react-hooks';
|
|
|
|
/** @type {Awaited<import('typescript-eslint').Config>} */
|
|
export default [
|
|
{
|
|
files: ['**/*.ts', '**/*.tsx'],
|
|
plugins: {
|
|
react: reactPlugin,
|
|
'react-compiler': compilerPlugin,
|
|
'react-hooks': hooksPlugin,
|
|
},
|
|
rules: {
|
|
...reactPlugin.configs['jsx-runtime'].rules,
|
|
...hooksPlugin.configs.recommended.rules,
|
|
'react/prop-types': 'off',
|
|
'react/jsx-key': 'error',
|
|
'react-hooks/exhaustive-deps': 'off',
|
|
'react/display-name': 'off',
|
|
'react-hooks/rules-of-hooks': 'off',
|
|
'react-compiler/react-compiler': 'error',
|
|
},
|
|
languageOptions: {
|
|
globals: {
|
|
React: 'writable',
|
|
},
|
|
},
|
|
},
|
|
];
|