-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
70 lines (69 loc) · 1.94 KB
/
eslint.config.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
import js from '@eslint/js'
import ts from '@typescript-eslint/eslint-plugin'
import prettierConfig from 'eslint-config-prettier'
import tsParser from '@typescript-eslint/parser'
export default [
js.configs.recommended,
ts.configs.recommended,
prettierConfig,
{
files: ['src/ts/**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
globals: {
axios: 'readonly',
jQuery: 'readonly',
},
parser: tsParser,
parserOptions: {},
},
plugins: { ts },
rules: {
'no-unused-vars': 'off', // Required by @typescript-eslint/no-unused-vars
'padding-line-between-statements': [
'error',
{ blankLine: 'always', prev: ['class', 'function'], next: '*' },
{
blankLine: 'always',
prev: '*',
next: ['class', 'function', 'return', 'try'],
},
{
blankLine: 'always',
prev: ['import', 'for', 'if', 'switch', 'while'],
next: ['const', 'expression', 'let'],
},
{
blankLine: 'always',
prev: ['const', 'expression', 'let'],
next: ['for', 'if', 'switch', 'try', 'while'],
},
{
blankLine: 'always',
prev: ['const', 'expression', 'import', 'let'],
next: 'export',
},
{ blankLine: 'always', prev: ['for', 'switch', 'while'], next: 'if' },
{ blankLine: 'always', prev: ['if', 'switch', 'while'], next: 'for' },
{ blankLine: 'always', prev: ['if', 'for', 'while'], next: 'switch' },
{ blankLine: 'always', prev: ['if', 'for', 'switch'], next: 'while' },
],
/* @typescript-eslint */
'ts/consistent-type-imports': [
'error',
{
prefer: 'type-imports',
disallowTypeAnnotations: true,
fixStyle: 'separate-type-imports',
},
],
'ts/no-unused-vars': ['error', { vars: 'all', args: 'all' }],
// 'ts/padding-line-between-statements': [
// 'error',
// { blankLine: 'always', prev: '*', next: 'interface' },
// { blankLine: 'always', prev: 'interface', next: '*' },
// ],
},
},
]