-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.cjs
91 lines (89 loc) · 2.13 KB
/
.eslintrc.cjs
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
/* eslint-env node */
require('@rushstack/eslint-patch/modern-module-resolution')
module.exports = {
root: true,
extends: [
'plugin:vue/vue3-recommended',
'eslint:recommended',
'@vue/eslint-config-typescript',
],
parserOptions: {
ecmaVersion: 'latest',
},
rules: {
// lines for vue eslint config
'vue/max-attributes-per-line': [
'error',
{
singleline: {
max: 3,
},
multiline: {
max: 1,
},
},
],
'vue/html-indent': ['error', 2],
'no-multi-spaces': ['error'],
// lines for simple eslint config
'no-unused-vars': [
'error',
{
args: 'none',
},
],
semi: ['error', 'never'], // no ;
quotes: ['error', 'single'], // no "
indent: ['error', 2, { SwitchCase: 1 }],
'no-multiple-empty-lines': [
'error',
{
// limit empty lines
max: 2,
maxEOF: 0,
},
],
'space-before-function-paren': ['error', 'always'], // space before "()"" in function
'space-before-blocks': ['error', 'always'], // space before {}
'space-in-parens': ['error', 'never'],
'array-bracket-spacing': ['error', 'never'],
// 'comma-dangle': ['error', 'never'],
'max-params': ['error', 3],
'padding-line-between-statements': [
'error',
{
blankLine: 'always',
prev: ['const', 'let', 'var'],
next: '*',
},
{
blankLine: 'any',
prev: ['const', 'let', 'var'],
next: ['const', 'let', 'var'],
},
{
blankLine: 'always',
prev: 'import',
next: 'export',
},
{
blankLine: 'always',
prev: '*',
next: ['throw', 'return', 'function', 'debugger'],
},
{
blankLine: 'always',
prev: 'debugger',
next: '*',
},
{
blankLine: 'always',
prev: '*',
next: 'multiline-block-like',
},
],
'no-async-promise-executor': 0, // allows using an async function as a Promise executor.
'no-undef': 'warn',
'no-useless-catch': 'off', // TODO: research how to fix no-useless-catch
},
}