-
Notifications
You must be signed in to change notification settings - Fork 21
/
.eslintrc.js
76 lines (74 loc) · 2.6 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
module.exports = {
root: true,
env: { node: true },
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'import', 'sort-imports-es6-autofix'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
],
rules: {
/* -------------------- error -------------------- */
indent: [2, 2, { SwitchCase: 1 }],
quotes: [2, 'single'],
'no-trailing-spaces': [2],
'quote-props': [2, 'as-needed'],
'arrow-parens': [2, 'as-needed'],
'eol-last': [2, 'always'],
'object-curly-spacing': [2, 'always'],
'comma-dangle': [2, {
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'only-multiline',
}],
/* -------------------- warn -------------------- */
semi: [1, 'always'],
'@typescript-eslint/no-unused-vars': [1, {
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
}],
'sort-imports-es6-autofix/sort-imports-es6': 1,
'max-len': [1, {
code: 120,
ignoreComments: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
}],
/* -------------------- off -------------------- */
'@typescript-eslint/no-extra-semi': 0,
'@typescript-eslint/no-use-before-define': 0,
'@typescript-eslint/explicit-member-accessibility': 0,
'@typescript-eslint/naming-convention': 0,
'@typescript-eslint/no-explicit-any': 0, // any is sometimes unavoidable
'@typescript-eslint/consistent-type-definitions': 0, // can use Type and Interface
'@typescript-eslint/explicit-function-return-type': 0, // type inference on return type is useful
'@typescript-eslint/no-parameter-properties': 0,
'@typescript-eslint/typedef': 0,
'@typescript-eslint/no-non-null-assertion': 0, // can assert not null
'@typescript-eslint/no-empty-function': 0,
'@typescript-eslint/explicit-module-boundary-types': 0,
'@typescript-eslint/ban-ts-comment': 0,
'@typescript-eslint/no-non-null-asserted-optional-chain': 0,
'@typescript-eslint/no-unused-expressions': 0, // short circuit if
'import/no-named-as-default-member': 0,
'import/no-named-as-default': 0,
'no-unused-expressions': 0, // short ciucuit if
'no-useless-escape': 0,
'max-lines': 0,
},
settings: {
'import/resolver': {
typescript: {
project: 'tsconfig.json',
},
},
},
ignorePatterns: [
'**/e2e-truffle/**',
],
};