-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.eslintrc.js
121 lines (121 loc) · 4.04 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
module.exports = {
root: true,
env: {
node: true
},
extends: [
'plugin:vue/essential',
'@vue/standard',
'@vue/typescript/recommended'
],
parserOptions: {
ecmaVersion: 2020
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'quotes': 'off',
'@typescript-eslint/quotes': ['error', 'single'],
'semi': 'off',
'@typescript-eslint/semi': ['error', 'never'],
'indent': 'off',
'@typescript-eslint/indent': ['error', 4],
'vue/html-indent': ['error', 4],
'vue/script-indent': ['error', 4],
'space-before-function-paren': 'off',
'@typescript-eslint/space-before-function-paren': ['error', {
anonymous: 'always',
named: 'never',
asyncArrow: 'always'
}],
'quote-props': ['error', 'consistent'],
'space-infix-ops': ['error'],
'no-useless-constructor': 'off',
'@typescript-eslint/no-useless-constructor': ['error'],
'@typescript-eslint/array-type': ['error', {
default: 'generic'
}],
'@typescript-eslint/class-literal-property-style': 'error',
'@typescript-eslint/member-delimiter-style': ['error', {
'multiline': {
'delimiter': 'none',
'requireLast': false
},
'singleline': {
'delimiter': 'semi',
'requireLast': false
}
}],
'@typescript-eslint/method-signature-style': ['error', 'property'],
'lines-between-class-members': 'off',
'@typescript-eslint/lines-between-class-members': ['error', {
'exceptAfterSingleLine': true
}],
'@typescript-eslint/type-annotation-spacing': ['error'],
'no-void': 'off'
},
overrides: [
{
files: [
'**/__tests__/*.{j,t}s?(x)',
'**/tests/**/*.spec.{j,t}s?(x)'
],
env: {
jest: true
}
},
{
files: [
'src/**/*.ts',
'src/**/*.tsx',
'src/**/*.vue',
'tests/**/*.ts',
'tests/**/*.tsx'
],
extends: [
'plugin:@typescript-eslint/recommended-requiring-type-checking'
],
parser: require.resolve('vue-eslint-parser'),
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json']
},
rules: {
'camelcase': 'off',
'@typescript-eslint/naming-convention': [
'error',
{
'selector': 'default',
'format': ['camelCase']
},
{
'selector': 'variable',
'format': ['camelCase', 'UPPER_CASE']
},
{
'selector': 'parameter',
'format': ['camelCase'],
'leadingUnderscore': 'allow'
},
{
'selector': 'memberLike',
'format': ['camelCase'],
'trailingUnderscore': 'allow'
},
{
'selector': 'memberLike',
'modifiers': ['private'],
'format': ['camelCase'],
'leadingUnderscore': 'require'
},
{
'selector': 'typeLike',
'format': ['PascalCase']
}
],
'@typescript-eslint/no-unnecessary-condition': 'warn',
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'warn'
}
}
]
}