-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.js
80 lines (80 loc) · 2.25 KB
/
.eslintrc.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
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
75
76
77
78
79
80
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
extends: [
'airbnb',
'plugin:react/recommended',
'plugin:prettier/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
],
plugins: ['react', 'react-hooks'],
env: {
browser: true,
es6: true,
node: true,
},
rules: {
'no-useless-constructor': 'off',
'max-len': [
'error',
{
code: 120,
tabWidth: 2,
ignoreComments: true,
ignoreTrailingComments: true,
ignoreStrings: true,
ignoreUrls: true,
ignoreTemplateLiterals: true,
ignorePattern: '^import\\s.+\\sfrom\\s.+;$',
},
],
'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }],
'no-use-before-define': 'off',
'linebreak-style': 'off',
camelcase: 'warn',
'max-classes-per-file': 'off',
'class-methods-use-this': 'off',
'import/no-extraneous-dependencies': 'off',
'import/prefer-default-export': 'off',
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
ts: 'never',
jsx: 'never',
tsx: 'never',
},
],
'no-underscore-dangle': 0,
'no-shadow': 'off',
// react
'react/jsx-filename-extension': [2, { extensions: ['.js', '.jsx', '.ts', '.tsx'] }],
'react/require-default-props': 0,
'react/jsx-props-no-spreading': 1,
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',
'react/jsx-wrap-multilines': 'off',
'react/jsx-indent': 'off',
'react/jsx-one-expression-per-line': 'off',
'react/jsx-curly-newline': 'off',
'react/prop-types': 'off',
'react/destructuring-assignment': 'off',
'react/no-unused-prop-types': 'off',
'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks
'react-hooks/exhaustive-deps': 'warn', // Checks effect dependencies
// typescript
'@typescript-eslint/no-var-requires': 'warn',
'@typescript-eslint/no-use-before-define': 2,
'@typescript-eslint/no-shadow': 'error',
},
ignorePatterns: ['generated/**/*.tsx'],
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.ts', '.jsx', '.tsx'],
},
},
},
};