-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
48 lines (47 loc) · 1.36 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
44
45
46
47
48
import { defineFlatConfig } from 'eslint-define-config';
import typescriptParser from '@typescript-eslint/parser';
import typescript from '@typescript-eslint/eslint-plugin';
import react from 'eslint-plugin-react';
import reactHooks from 'eslint-plugin-react-hooks';
export default defineFlatConfig([
{
files: [
'**/*.{ts,tsx}',
],
languageOptions: {
parser: typescriptParser,
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
},
settings: {
react: {
version: 'detect',
},
},
plugins: {
'@typescript-eslint': typescript,
react,
'react-hooks': reactHooks,
},
rules: {
...typescript.configs['recommended'].rules,
...typescript.configs['eslint-recommended'].rules,
...react.configs['recommended'].rules,
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',
'react-hooks/exhaustive-deps': 'warn',
},
},
{
rules: {
quotes: ['warn', 'single'],
'comma-dangle': ['warn', 'always-multiline'],
semi: ['error'],
},
},
]);