1
1
import typescriptEslint from '@typescript-eslint/eslint-plugin' ;
2
+ import stylisticEslint from '@stylistic/eslint-plugin' ;
2
3
import tsParser from '@typescript-eslint/parser' ;
3
4
4
5
export default [
5
6
{
6
7
files : [ '**/*.ts' ] ,
7
8
ignores : [ '**/dist/**' , '**/node_modules/**' , '**/public/**' ] ,
8
- plugins : { '@typescript-eslint' : typescriptEslint } ,
9
- languageOptions : {
10
- parser : tsParser ,
11
- ecmaVersion : 5 ,
12
- sourceType : 'module' ,
13
- } ,
14
-
9
+ plugins : { '@typescript-eslint' : typescriptEslint , '@stylistic' : stylisticEslint } ,
10
+ languageOptions : { parser : tsParser , ecmaVersion : 5 , sourceType : 'module' } ,
15
11
rules : {
16
- 'linebreak-style' : [ 'error' , 'unix' ] ,
17
- 'prefer-spread' : 'off' ,
18
- 'prefer-rest-params' : 'off' ,
12
+ '@stylistic/indent' : [ 'error' , 2 ] ,
13
+ '@stylistic/quotes' : [ 'error' , 'single' , { avoidEscape : true , allowTemplateLiterals : true } ] ,
14
+ '@stylistic/semi' : [ 'error' , 'always' ] ,
15
+ '@stylistic/comma-dangle' : [ 'error' , 'always-multiline' ] ,
16
+ '@stylistic/object-curly-spacing' : [ 'error' , 'always' ] ,
17
+ '@stylistic/space-before-function-paren' : [ 'error' , 'never' ] ,
18
+ '@stylistic/max-len' : [
19
+ 'warn' ,
20
+ {
21
+ code : 110 ,
22
+ ignoreUrls : true ,
23
+ ignoreStrings : true ,
24
+ ignoreComments : true ,
25
+ ignoreTemplateLiterals : true ,
26
+ } ,
27
+ ] ,
28
+
19
29
'@typescript-eslint/no-empty-interface' : 'off' ,
20
30
'@typescript-eslint/explicit-module-boundary-types' : 'off' ,
21
31
'@typescript-eslint/no-empty-function' : 'off' ,
@@ -24,22 +34,17 @@ export default [
24
34
'@typescript-eslint/no-this-alias' : 'off' ,
25
35
'@typescript-eslint/no-unused-vars' : [
26
36
'warn' ,
27
- {
28
- varsIgnorePattern : '^_' ,
29
- argsIgnorePattern : '^_' ,
30
- caughtErrorsIgnorePattern : '^_' ,
31
- } ,
37
+ { varsIgnorePattern : '^_' , argsIgnorePattern : '^_' , caughtErrorsIgnorePattern : '^_' } ,
32
38
] ,
39
+
40
+ 'linebreak-style' : [ 'error' , 'unix' ] ,
41
+ 'prefer-spread' : 'off' ,
42
+ 'prefer-rest-params' : 'off' ,
33
43
'no-duplicate-imports' : 'error' ,
34
44
'no-useless-escape' : 'off' ,
35
45
'no-var' : 'warn' ,
36
46
'no-async-promise-executor' : 'warn' ,
37
- 'no-constant-condition' : [
38
- 'warn' ,
39
- {
40
- checkLoops : false ,
41
- } ,
42
- ] ,
47
+ 'no-constant-condition' : [ 'warn' , { checkLoops : false } ] ,
43
48
'no-restricted-globals' : [
44
49
'error' ,
45
50
'addEventListener' ,
@@ -200,7 +205,7 @@ export default [
200
205
'scrollTo' ,
201
206
'scrollX' ,
202
207
'scrollY' ,
203
- //" self" ,
208
+ //' self' ,
204
209
'status' ,
205
210
'statusbar' ,
206
211
'stop' ,
0 commit comments