-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.cjs
86 lines (81 loc) · 2.08 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
/* 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'],
'vue/html-self-closing': [
'error',
{
html: {
void: 'always', // area , base , br , col , command , embed , hr , img , input , keygen , link , meta , param , source , track , wbr.
normal: 'never', // p, h, div ...
component: 'always', // custom components
},
},
],
'vue/html-closing-bracket-spacing': [
'error',
{
startTag: 'never',
endTag: 'never',
selfClosingTag: 'always',
},
],
'vue/html-closing-bracket-newline': [
'error',
{
singleline: 'never',
multiline: 'always',
},
],
// 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],
'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
},
}