-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
66 lines (64 loc) · 1.69 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
module.exports = {
env: {
browser: true,
es2021: true,
},
extends: [
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended'
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: [
'react',
'react-hooks',
'@typescript-eslint',
],
rules: {
// ------------------ general ------------------
'quotes': ['error', 'single'],
'max-len': ['warn', { code: 150, ignoreComments: true }],
'max-classes-per-file': ['warn', 1],
'no-underscore-dangle': 0,
'prefer-destructuring': 0,
'no-plusplus': 0,
'import/no-unresolved': 0, // webpack will handle this
'import/extensions': 0, // webpack will handle this
'no-param-reassign': 0,
'one-var': 0,
'one-var-declaration-per-line': 0,
'no-restricted-syntax': 'warn',
'no-continue': 0,
eqeqeq: 'warn',
'prefer-const': 'warn',
'jsx-quotes': ['warn', 'prefer-single'],
'no-restricted-imports': ['error', {
'patterns': ['.*']
}],
// ------------------ react ------------------
'react/function-component-definition': 0,
'react/jsx-filename-extension': [1, { extensions: ['.tsx', '.jsx'] }],
'react/jsx-uses-react': 0,
'react/react-in-jsx-scope': 0,
// ------------------ typescript ------------------
'@typescript-eslint/ban-types': 'warn',
'@typescript-eslint/ban-ts-comment': 'warn',
'@typescript-eslint/no-inferrable-types': 'warn',
},
settings: {
'import/resolver': 'webpack',
'react': {
'version': 'detect'
}
},
globals: {
JSX: true,
}
};