-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
118 lines (118 loc) · 3.3 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
module.exports = {
env: {
es2021: true,
jest: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking'
],
overrides: [],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 'latest',
sourceType: 'module',
project: './tsconfig.json',
},
plugins: ['react', 'react-hooks', '@typescript-eslint'],
root: true,
rules: {
camelcase: 'warn',
'spaced-comment': 'warn',
'no-duplicate-imports': 'error',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'off',
'@typescript-eslint/no-unused-vars': ['error', {
'vars': 'all',
'args': 'none',
'ignoreRestSiblings': false,
}],
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'no-multiple-empty-lines': ['error', {'max': 1,}],
'indent': ['error', 'tab', {SwitchCase: 1,}],
'quotes': ['error', 'single'],
'semi': ['error', 'always'],
'comma-dangle': ['error', {
'arrays': 'never',
'objects': 'always',
'imports': 'always',
'exports': 'always',
'functions': 'never',
}],
'eqeqeq': ['error', 'always'],
'no-var': ['error'],
'prefer-arrow-callback': ['error'],
'no-useless-return': ['error'],
'max-len': ['warn', {
'code': 240,
'tabWidth': 4,
'ignoreUrls': true,
'ignoreTrailingComments': true,
'ignoreStrings': true,
'ignoreTemplateLiterals': true,
'ignoreRegExpLiterals': true,
}],
'no-console': ['error'],
'no-case-declarations': 'off',
'no-mixed-spaces-and-tabs': ['error'],
'key-spacing': ['error', {'afterColon': true, 'mode': 'strict',}],
'object-curly-spacing': ['error', 'never'],
'react/button-has-type': ['error'],
'react/destructuring-assignment': ['error', 'always'],
'react/no-deprecated': ['error'],
'react/no-direct-mutation-state': ['error'],
'react/no-redundant-should-component-update': ['error'],
'react/no-typos': ['error'],
'react/no-unescaped-entities': ['error'],
'react/no-unsafe': ['error'],
'react/no-unused-state': ['error'],
'react/prefer-es6-class': ['warn'],
'react/prefer-read-only-props': ['error'],
'react/react-in-jsx-scope': ['error'],
'react/require-render-return': ['error'],
'react/state-in-constructor': ['error'],
'react/jsx-curly-spacing': [2, {
'when': 'always',
'spacing': {
'objectLiterals': 'never',
},
}],
'react/jsx-indent': ['error', 'tab'],
'react/jsx-key': ['error'],
'react/jsx-no-bind': ['error'],
'react/jsx-no-duplicate-props': ['error'],
'react/jsx-no-target-blank': ['error'],
'react/jsx-no-undef': ['error'],
'react/jsx-no-useless-fragment': ['error'],
'react/jsx-props-no-multi-spaces': ['error'],
'react/prop-types': ['off'],
'react/jsx-first-prop-new-line': ['error', 'multiline'],
'react/jsx-max-props-per-line': ['error', {'maximum': 1,}],
'react/jsx-no-comment-textnodes': ['error'],
'react/jsx-newline': ['error', {
'prevent': true,
}],
'arrow-parens': ['error', 'as-needed'],
'react/jsx-indent-props': ['error', 'tab'],
'react/jsx-tag-spacing': [
'error', {
'beforeSelfClosing': 'always',
}
],
},
settings: {
'import/resolver': {
typescript: {},
},
react: {
version: 'detect',
},
},
};