-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.eslintrc.js
128 lines (124 loc) · 4.49 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
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
'prettier',
],
root: true,
env: {
node: true,
jest: true,
},
ignorePatterns: ['.eslintrc.js', 'build/**', 'buildDev/**'],
rules: {
'multiline-ternary': 'always-multiline',
'arrow-parens': ['error', 'as-needed'],
'prettier/prettier': ['error', { tabWidth: 4 }],
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/adjacent-overload-signatures': 2,
'@typescript-eslint/array-type': [
1,
{
default: 'array-simple',
},
],
'@typescript-eslint/ban-tslint-comment': 1,
'@typescript-eslint/ban-types': [
2,
{
extendDefaults: true,
types: {
'{}': false,
object: false,
},
},
],
'@typescript-eslint/class-literal-property-style': 1,
// '@typescript-eslint/consistent-indexed-object-style': 2,
'@typescript-eslint/consistent-type-assertions': 2,
'@typescript-eslint/consistent-type-definitions': [2, 'interface'],
'@typescript-eslint/member-delimiter-style': [1],
// '@typescript-eslint/member-ordering': 1,
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'typeLike',
format: ['PascalCase'],
},
],
'@typescript-eslint/no-confusing-non-null-assertion': 2,
'@typescript-eslint/no-empty-interface': 2,
'@typescript-eslint/no-extra-non-null-assertion': 2,
'@typescript-eslint/no-extraneous-class': 2,
'@typescript-eslint/no-invalid-void-type': 1,
'@typescript-eslint/no-misused-new': 2,
'@typescript-eslint/no-namespace': 2,
'@typescript-eslint/no-non-null-asserted-optional-chain': 1,
'@typescript-eslint/no-parameter-properties': [
2,
{
allows: [
'readonly',
'private',
'protected',
'public',
'private readonly',
'protected readonly',
'public readonly',
],
},
],
'@typescript-eslint/no-redeclare': [
2,
{
ignoreDeclarationMerge: true,
},
],
'@typescript-eslint/no-require-imports': 2,
'@typescript-eslint/no-var-requires': 2,
'@typescript-eslint/no-this-alias': [
'error',
{
allowDestructuring: true, // Allow `const { props, state } = this`; false by default
allowedNames: ['self'], // Allow `const self = this`; `[]` by default
},
],
'@typescript-eslint/no-unnecessary-type-constraint': 1,
'@typescript-eslint/prefer-as-const': 1,
// '@typescript-eslint/prefer-function-type': 1,
'@typescript-eslint/prefer-literal-enum-member': 2,
'@typescript-eslint/triple-slash-reference': 2,
'@typescript-eslint/type-annotation-spacing': 1,
'@typescript-eslint/unified-signatures': 1,
'no-unused-vars': 0,
'@typescript-eslint/no-unused-vars': [
1,
{
vars: 'all',
args: 'after-used',
ignoreRestSiblings: true,
varsIgnorePattern: '^_',
argsIgnorePattern: '^_|^err|^ev', // _xxx, err, error, ev, event
},
],
'default-param-last': 0,
'@typescript-eslint/default-param-last': 2,
'no-dupe-class-members': 0,
'@typescript-eslint/no-dupe-class-members': 2,
// disabled rules
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/explicit-member-accessibility': 0,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-inferrable-types': 0,
'@typescript-eslint/no-non-null-assertion': 0,
},
};