-
-
Notifications
You must be signed in to change notification settings - Fork 390
/
.eslintrc.cjs
76 lines (73 loc) · 1.95 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
// https://eslint.org/docs/user-guide/configuring
module.exports = {
root: true,
parserOptions: {
sourceType: 'module',
ecmaVersion: 2018,
project: './tsconfig.json',
},
env: {
es6: true,
node: true,
},
extends: [
'airbnb-base',
'airbnb-typescript/base',
],
plugins: [
'no-floating-promise',
],
// add your custom rules here
rules: {
'no-underscore-dangle': 0,
'no-plusplus': 0, // i++ OK :D
'class-methods-use-this': 0,
'radix': 0,
'prefer-destructuring': 0,
'no-param-reassign': 0, // sometimes it's just much easier
'@typescript-eslint/lines-between-class-members': 0, // grouping related one-liners can be nice
'no-continue': 0,
// override airbnb - breaks old version of node - https://github.com/eslint/eslint/issues/7749
'@typescript-eslint/comma-dangle': ['error', {
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'never', // this breaks
}],
'no-multiple-empty-lines': 0, // sometimes helpful to break up sections of code
'import/prefer-default-export': 0,
'import/no-cycle': 0,
'grouped-accessor-pairs': 0,
"@typescript-eslint/naming-convention": 0,
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
},
],
'max-len': ['error', 120, 2, { // bumped to 120, otherwise same as airbnb's rule but ignoring comments
ignoreUrls: true,
ignoreComments: true,
ignoreRegExpLiterals: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
}],
},
overrides: [
{ // extra rules for tests
files: 'test/*',
rules: {
'no-await-in-loop': 0,
}
},
{ // relaxed rules for examples
files: 'examples/*',
rules: {
'no-console': 0,
'no-unused-vars': 0,
},
},
],
};