-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
43 lines (39 loc) · 1.21 KB
/
eslint.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import eslintPluginReact from 'eslint-plugin-react';
import eslintPluginReactHooks from 'eslint-plugin-react-hooks';
import eslintConfigPrettier from 'eslint-config-prettier/flat';
export default tseslint.config({
files: ['src/**/*.ts', 'src/**/*.tsx'],
extends: [
eslint.configs.recommended,
tseslint.configs.strictTypeChecked,
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
eslintPluginReact.configs.flat?.['recommended'] ?? {},
eslintPluginReact.configs.flat?.['jsx-runtime'] ?? {},
{
rules: {
'react/jsx-boolean-value': ['error', 'always'],
'react/jsx-curly-brace-presence': 'error',
'react/no-unknown-property': 'error',
'react/prop-types': 'off', // handled by TypeScript
'react/self-closing-comp': 'error',
},
settings: { react: { version: 'detect' } },
},
{
plugins: {
'react-hooks': eslintPluginReactHooks,
},
rules: { ...eslintPluginReactHooks.configs.recommended.rules },
},
eslintConfigPrettier,
],
});