-
Notifications
You must be signed in to change notification settings - Fork 68
/
.eslintrc.json
188 lines (187 loc) · 6.9 KB
/
.eslintrc.json
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
{
"extends": [
"plugin:vue/recommended",
"eslint:all",
"@vue/typescript",
"plugin:@typescript-eslint/all",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:sonarjs/recommended"
],
"plugins": [
"only-warn",
"babel",
"sonarjs"
],
"parser": "vue-eslint-parser",
"parserOptions": {
"parser": "@typescript-eslint/parser",
"sourceType": "module",
"project": "./tsconfig.json"
},
"rules": {
"no-warning-comments": 0,
"object-curly-spacing": 0,
"init-declarations": 0, // poor choice
"func-style": [1, "declaration"],
"one-var": 0, // poor choice
"multiline-comment-style": 1, // turned off by default
"no-plusplus": 0, // too aggresive
"quote-props": [1, "as-needed"],
"camelcase": 0, // replaced with babel-camelcase
"no-ternary": 0, // too aggressive
"multiline-ternary": 0,
"sort-imports": 0,
"new-cap": 0, // babel/new-cap
"array-element-newline": [1, "consistent"],
"comma-dangle": 0, // using typescript-eslint/comma-dangle
"function-call-argument-newline": [1, "consistent"],
"max-len": [1, { "code": 140, "ignorePattern": "http?s:\/\/", "ignoreTrailingComments": true}], // override 80 that is too low
"padded-blocks": [1, "never"],
"max-statements": [1, 25],
"function-paren-newline": [1, "consistent"],
"no-inline-comments": 0,
"no-confusing-arrow": 0, // conflict with no-extra-parens
"max-params": [1, 5],
"no-void": [0], // allow void for void promise
"@typescript-eslint/no-untyped-public-signature": 0, // this breaks a lot: constructions public, ES6 setter should have return type etc
"@typescript-eslint/ban-ts-ignore": 0, // who cares, we explicitly define it.
"@typescript-eslint/ban-ts-comment": 0, // who cares, we explicitly define it.
"@typescript-eslint/space-before-function-paren": [1, "never"],
"@typescript-eslint/strict-boolean-expressions": 0,
"@typescript-eslint/no-unnecessary-type-assertion": 0, // this shity rule has bugs during lint:fix
"@typescript-eslint/indent": [1, 2], //replace 4 spaces
"@typescript-eslint/no-inferrable-types": 0, // @typescript-eslint/typedef
"@typescript-eslint/no-non-null-assertion": 0,
"@typescript-eslint/no-unused-vars-experimental": 0, // doesn't work with vue
"@typescript-eslint/no-type-alias": 0,
"@typescript-eslint/no-magic-numbers": [
"error",
{
"ignoreReadonlyClassProperties": true,
"ignoreEnums": true,
"ignore": [
-1,
0,
1,
1000
],
"enforceConst": true
}
],
"@typescript-eslint/comma-dangle": [1, "always-multiline"],
"@typescript-eslint/method-signature-style": [1, "method"],
"@typescript-eslint/init-declarations": 0, // let a ; try {a = funct()} catch (e) throw e; if a.sdfsd . In this example we can't have instant init
"@typescript-eslint/prefer-readonly-parameter-types": 0, // too many issues, we can't mofidy arguments, we can' use type like number[], because rule @typescript-eslint/array-type
"@typescript-eslint/naming-convention": [1,
{
"selector": "property",
"format": ["PascalCase", "camelCase"] // PascalCase for Vue-property-decorator components: {AppAlert}
}
],
"babel/object-curly-spacing": 1,
"babel/quotes": 1,
"babel/semi": 1,
"babel/no-unused-expressions": 1,
"babel/valid-typeof": 1,
"babel/new-cap": 1,
"babel/camelcase": 0, // use typescript-eslint/naming-convention
"babel/no-invalid-this": 1,
"import/no-named-as-default": 1, //is not part of default sert
"import/no-unresolved": 0,
"import/no-relative-parent-imports": 1,
"import/dynamic-import-chunkname": 0,
"import/exports-last":1,
"import/extensions": [1, "never", {"json": "always", "vue": "always", "sass": "always", "png": "always", "wav": "always", "mp3": "always"}],
"import/first":1,
"import/group-exports": 0, // vue3
"import/max-dependencies": 0,
"import/newline-after-import": 1,
"import/no-absolute-path":1,
"import/no-amd": 1,
"import/no-anonymous-default-export":1,
"import/no-commonjs": 1,
"import/no-cycle":1,
"import/no-default-export": 1,
"import/no-deprecated":1,
"import/no-dynamic-require": 1,
"import/no-extraneous-dependencies":1,
"import/no-internal-modules": 1,
"import/no-mutable-exports":1,
"import/no-named-default": 1,
"import/no-named-export":0, // we want them
"import/no-namespace": 0,
"import/no-nodejs-modules":1,
"import/no-restricted-paths": 1,
"import/no-self-import":1,
"import/no-unassigned-import": [1, {"allow": ["**/*.sass", "**/*.css"]}],
"import/no-unused-modules":1,
"import/no-useless-path-segments": 1,
"import/no-webpack-loader-syntax":1,
"import/order": 0, // doesn't work with sorted-import
"import/prefer-default-export":0, // default exports are hell to IDE refactor support
"import/unambiguous": 1,
"vue/array-bracket-spacing":1,
"vue/arrow-spacing": 1,
"vue/block-spacing":1,
"vue/brace-style": 1,
"vue/camelcase":1,
"vue/comma-dangle": 0, // comma-spacing works fine
"vue/component-name-in-template-casing":1,
"vue/dot-location": 1,
"vue/eqeqeq":1,
"vue/key-spacing": 1,
"vue/keyword-spacing":1,
"vue/match-component-file-name": 1,
"vue/no-boolean-default":1,
"vue/no-deprecated-scope-attribute": 1,
"vue/no-empty-pattern":1,
"vue/no-restricted-syntax": 1,
"vue/object-curly-spacing":1,
"vue/require-direct-export": 0, // doesn't work with vue-class-comp
"vue/script-indent":1,
"vue/space-infix-ops": 1,
"vue/space-unary-ops":1,
"vue/v-on-function-call": 1,
"vue/html-closing-bracket-spacing": [1, {"endTag": "never", "selfClosingTag": "never", "startTag": "never"}],
"vue/v-slot-style":1,
"vue/valid-v-slot": 1,
"vue/max-attributes-per-line": [1, {
"singleline": {
"max": 3
},
"multiline": {
"max": 1
}
}],
"vue/html-self-closing": [
1,
{
"html": {
"void": "always", // vue-ts template requires valid xml <this> is not valid but <this/> is
"normal": "always",
"component": "always"
}
}
],
"class-methods-use-this": 0,
"@typescript-eslint/no-unnecessary-condition": 0 // too many times we want to make sure that variable that is not null is present or not. Let's say window.RTPConnection is declaread as non-nullable but we still check it in runtime
},
"overrides": [
{
"files": ["*.vue", "*.d.ts"],
"rules": {
"import/no-default-export": 0
}
},
{
"files": ["*.vue"],
"rules": {
"@typescript-eslint/no-empty-function": 0, // empty method @Emit
"@typescript-eslint/prefer-readonly": 0, // can be used in template
"import/unambiguous": 0 // vue SFC can miss script tags
}
}
]
}