-
Notifications
You must be signed in to change notification settings - Fork 44
/
.eslintrc.cjs
74 lines (74 loc) · 2.08 KB
/
.eslintrc.cjs
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
module.exports = {
env: { browser: true, es2021: true },
extends: [
'airbnb',
'airbnb-typescript',
'airbnb/hooks',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
'prettier',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json'],
ecmaFeatures: {
jsx: true,
}, },
plugins: ['@typescript-eslint', 'react-refresh', 'import', 'prettier', 'simple-import-sort'],
rules: {
'react-refresh/only-export-components': 'warn',
'simple-import-sort/imports': 'warn',
'simple-import-sort/exports': 'warn',
'react/react-in-jsx-scope': 'off',
'react/jsx-no-useless-fragment': ['warn', { allowSingleChild: true }],
'@typescript-eslint/no-empty-interface': 'off',
'import/prefer-default-export': 'off',
'import/no-extraneous-dependencies': 'off',
'no-plusplus': 'off',
'no-restricted-syntax': 'warn',
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
'no-param-reassign': 'off',
'react/require-default-props': 'off',
'react/function-component-definition': 'off',
'react/jsx-props-no-spreading': 'off',
'react/no-unused-prop-types': 'warn',
'react/display-name': 'off',
'import/no-cycle': 'off',
'react/self-closing-comp': 'warn',
'react/prop-types': 'off',
},
settings: {
react: {
// Tells eslint-plugin-react to automatically detect the version of React to use.
version: 'detect',
},
'import/extensions': ['.js', '.jsx', '.ts', '.tsx'],
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {},
node: {
paths: ['node_modules', 'src'],
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
'eslint-import-resolver-custom-alias': {
alias: {
'@': 'src',
},
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
},
}