-
-
Notifications
You must be signed in to change notification settings - Fork 97
/
.eslintrc.js
129 lines (129 loc) · 3.46 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
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
119
120
121
122
123
124
125
126
127
128
129
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
env: {
es6: true,
browser: true,
node: true,
jest: true,
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:jsx-a11y/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
parserOptions: {
ecmaFeatures: {
jsx: true,
},
project: ['./tsconfig.eslint.json'],
sourceType: 'module',
},
settings: {
react: {
version: 'detect',
},
},
rules: {
'prettier/prettier': [
2,
{
printWidth: 120,
singleQuote: true,
semi: false,
arrowParens: 'always',
trailingComma: 'es5',
},
],
'arrow-parens': [2, 'always'],
camelcase: [2, { properties: 'never' }],
curly: [2, 'multi-line'],
indent: [2, 2, { SwitchCase: 1 }],
quotes: [2, 'single'],
semi: [2, 'never'],
eqeqeq: 2,
yoda: 2,
'block-spacing': 2,
'computed-property-spacing': 2,
'comma-dangle': [
2,
{
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'only-multiline',
},
],
'func-call-spacing': 2,
'eol-last': 2,
'no-empty': [2, { allowEmptyCatch: true }],
'no-undefined': 2,
'no-use-before-define': 0, // ts lint will take care of it
'no-multi-assign': 2,
'no-useless-concat': 2,
'no-useless-return': 2,
'no-shadow-restricted-names': 2,
'no-multi-spaces': 2,
'no-multi-str': 2,
'no-unused-vars': 0, // ts lint will take care of it
'no-alert': 0,
'no-console': 1,
'no-useless-constructor': 1,
'no-constant-condition': [2, { checkLoops: false }],
'no-duplicate-imports': [2, { includeExports: true }],
'no-trailing-spaces': 2,
'no-useless-computed-key': 2,
'no-useless-rename': 2,
'no-var': 2,
'space-before-blocks': 2,
'space-in-parens': 2,
'space-infix-ops': 2,
'space-unary-ops': [2, { words: true, nonwords: false }],
'space-before-function-paren': [
2,
{
anonymous: 'never',
named: 'never',
asyncArrow: 'always',
},
],
'template-tag-spacing': 2,
'max-len': [
2,
{
code: 120,
tabWidth: 2,
ignoreStrings: true,
ignoreComments: true,
ignoreTrailingComments: true,
ignoreTemplateLiterals: true,
ignoreRegExpLiterals: true,
},
],
'object-shorthand': 2,
'object-curly-spacing': [2, 'always'],
'prefer-const': 2,
'prefer-arrow-callback': 2,
'template-curly-spacing': [2, 'never'],
'@typescript-eslint/ban-ts-comment': 0,
'@typescript-eslint/no-misused-promises': 0,
'@typescript-eslint/no-unsafe-member-access': 0,
},
overrides: [
{
files: ['src/*.test.js', './webpack.config.js'],
rules: {
'@typescript-eslint/ban-ts-ignore': 0,
'@typescript-eslint/no-empty-function': 0,
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/no-unsafe-call': 0,
'@typescript-eslint/no-unsafe-member-access': 0,
'@typescript-eslint/no-unsafe-assignment': 0,
},
},
],
}