-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
116 lines (114 loc) · 3.9 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
module.exports = {
env: {
es2020: true,
node: true,
'cypress/globals': true,
},
extends: [
'airbnb-base',
'eslint-config-prettier',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'prettier/@typescript-eslint',
'plugin:cypress/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 11,
sourceType: 'module',
project: './tsconfig.json',
tsconfigRootDir: __dirname,
},
plugins: ['@typescript-eslint', 'cypress', 'import', 'prettier'],
rules: {
// Prettier violations should generate warnings
'prettier/prettier': 'warn',
// Rules disabled because they don't add value
'import/extensions': 0,
'import/no-cycle': 1, // Too much to change
'lines-between-class-members': 0,
'no-case-declarations': 0,
'no-undef-init': 0,
'no-underscore-dangle': 0,
'@typescript-eslint/camelcase': 0,
'@typescript-eslint/ban-ts-ignore': 0,
'@typescript-eslint/interface-name-prefix': 0,
'@typescript-eslint/no-inferrable-types': 0,
'@typescript-eslint/prefer-regexp-exec': 0,
// Warnings that should be solved in order to enable the rules as errors
'array-callback-return': 1,
'consistent-return': 1,
'default-case': 1,
'dot-notation': 1,
'guard-for-in': 1,
'no-console': 1,
'no-else-return': 1,
'no-extra-boolean-cast': 1,
'no-lonely-if': 1,
'no-multi-str': 1,
'no-nested-ternary': 1,
'no-restricted-syntax': 1,
'no-param-reassign': 1,
'no-prototype-builtins': 1,
'no-plusplus': 1,
'no-sequences': 1,
'no-shadow': 2,
'no-unused-expressions': 1,
'no-useless-return': 1,
'import/export': 1,
'import/first': 1,
'import/named': 1,
'import/newline-after-import': 1,
'import/no-duplicates': 2,
'import/no-extraneous-dependencies': [
1,
{
devDependencies: true,
optionalDependencies: false,
peerDependencies: false,
bundledDependencies: false,
},
],
'import/no-named-as-default': 1,
'import/no-unresolved': 1,
'import/no-useless-path-segments': 1,
'import/prefer-default-export': 1,
'import/order': 1,
'object-shorthand': 1,
'prefer-const': 2,
'prefer-destructuring': 1,
'prefer-template': 1,
'prefer-spread': 1,
'operator-assignment': 1,
radix: 1,
'spaced-comment': 1,
'@typescript-eslint/ban-types': 1,
'@typescript-eslint/explicit-function-return-type': 1,
'@typescript-eslint/no-empty-interface': 1,
'@typescript-eslint/no-explicit-any': 2,
'@typescript-eslint/no-for-in-array': 2,
'@typescript-eslint/no-namespace': 1,
'@typescript-eslint/no-non-null-assertion': 1,
'@typescript-eslint/no-misused-promises': 1,
'@typescript-eslint/no-unnecessary-type-assertion': 2,
'@typescript-eslint/no-unused-expressions': 2,
'@typescript-eslint/no-unused-vars': 2,
'@typescript-eslint/no-use-before-define': 2,
'@typescript-eslint/prefer-includes': 1,
'@typescript-eslint/unbound-method': 1,
// Cypress specific rules
'cypress/no-assigning-return-values': 2,
'cypress/no-unnecessary-waiting': 2,
'cypress/assertion-before-screenshot': 1,
'cypress/no-force': 2,
'cypress/no-async-tests': 2,
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
},
};