-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.js
56 lines (55 loc) · 2.02 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
module.exports = {
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: {
indent: [2, 2, { SwitchCase: 1 }],
quotes: [2, 'single'],
semi: [1, 'always'],
'no-trailing-spaces': [2],
'quote-props': [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',
}],
/* ---------- turn 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,
'no-unused-expressions': 0, // short ciucuit if
'max-lines': 0,
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'sort-imports-es6-autofix/sort-imports-es6': 'warn',
'@typescript-eslint/ban-ts-comment': 'off',
'no-useless-escape': 'off',
'@typescript-eslint/no-non-null-asserted-optional-chain': 'off',
'import/no-named-as-default-member': 'off',
'import/no-named-as-default': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
],
},
};