-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
211 lines (211 loc) · 5.16 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
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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
module.exports = {
root: true,
env: {
node: true,
},
extends: [
'plugin:vue/vue3-essential',
'eslint:recommended',
'@vue/typescript/recommended',
'@vue/prettier',
],
parserOptions: {
parser: '@typescript-eslint/parser',
ecmaVersion: 2020,
project: 'tsconfig.eslint.json',
},
rules: {
/*
** Javascript
** Docs: https://prettier.io/docs/en/options.html
*/
'prettier/prettier': [
'error',
{
semi: false,
singleQuote: true,
quoteProps: 'preserve',
bracketSpacing: true,
trailingComma: 'all',
printWidth: 80,
},
],
/*
** Typescript
** Docs: https://www.npmjs.com/package/@typescript-eslint/eslint-plugin#supported-rules
*/
'@typescript-eslint/await-thenable': 'error',
'@typescript-eslint/consistent-type-imports': 'error',
/*
** Javascript
** Docs: https://eslint.org/docs/rules/
*/
// Import Sorting
'sort-imports': [
'error',
{
ignoreCase: true,
ignoreDeclarationSort: true,
ignoreMemberSort: false,
},
],
// enforce consistent indentation
'indent': ['error', 2, { SwitchCase: 1 }],
// enforce a maximum line length
'max-len': ['error', { code: 100 }],
// enforce the consistent use of either backticks, double, or single quotes
'quotes': [
'error',
'single',
{
allowTemplateLiterals: true,
avoidEscape: true,
},
],
// require or disallow semicolons instead of ASI
'semi': ['error', 'never'],
// disallow the use of `console`
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
// disallow the use of `debugger`
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
// disallow empty block statements
'no-empty': 'error',
// disallow multiple spaces
'no-multi-spaces': 'error',
// enforce consistent spacing between keys and values in object literal
// properties
'key-spacing': [
'error',
{
beforeColon: false,
afterColon: true,
mode: 'strict',
},
],
// enforce consistent spacing inside array brackets
'array-bracket-spacing': ['error', 'never'],
// enforce consistent spacing before and after the arrow in arrow functions
'arrow-spacing': [
'error',
{
before: true,
after: true,
},
],
// enforce consistent brace style for blocks
'brace-style': [
'error',
'1tbs',
{
allowSingleLine: true,
},
],
// require or disallow trailing commas
'comma-dangle': ['error', 'always-multiline'],
// enforce consistent spacing before and after commas
'comma-spacing': 'error',
// disallow multiple empty lines
'no-multiple-empty-lines': [
'error',
{
maxBOF: 0,
max: 1,
maxEOF: 1,
},
],
// require or disallow padding within blocks
'padded-blocks': [
'error',
{
blocks: 'never',
classes: 'always',
switches: 'never',
},
],
// require or disallow padding lines between statements
'padding-line-between-statements': [
'error',
{
blankLine: 'always',
prev: '*',
next: 'return',
},
{
blankLine: 'always',
prev: ['const', 'let'],
next: '*',
},
{
blankLine: 'any',
prev: ['const', 'let'],
next: ['const', 'let'],
},
{
blankLine: 'always',
prev: '*',
next: 'if',
},
{
blankLine: 'always',
prev: 'if',
next: '*',
},
{
blankLine: 'always',
prev: 'directive',
next: '*',
},
{
blankLine: 'any',
prev: 'directive',
next: 'directive',
},
{
blankLine: 'always',
prev: 'export',
next: '*',
},
{
blankLine: 'always',
prev: 'import',
next: '*',
},
{
blankLine: 'never',
prev: 'import',
next: 'import',
},
],
// require quotes around object literal property names
'quote-props': ['error', 'consistent-as-needed'],
// enforce consistent spacing before blocks
'space-before-blocks': ['error', 'always'],
// enforce consistent spacing inside parentheses
'space-in-parens': ['error', 'never'],
// enforce consistent spacing before and after keywords
'keyword-spacing': [
'error',
{
before: true,
},
],
// require spacing around infix operators
'space-infix-ops': 'error',
// enforce consistent spacing inside braces
'object-curly-spacing': ['error', 'always'],
// enforce consistent spacing before `function` definition opening parenthesis
'space-before-function-paren': ['error', 'never'],
/*
** VUE
** Docs: https://eslint.vuejs.org/rules/
*/
// require or disallow padding lines between blocks
'vue/padding-line-between-blocks': ['error', 'always'],
'vue/multi-word-component-names': [
'error',
{
ignores: ['Card'],
},
],
},
}