-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc
143 lines (143 loc) · 3.01 KB
/
.eslintrc
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
{
"root": true,
"extends": [
"eslint:recommended",
"plugin:vue/vue3-essential",
"@vue/eslint-config-typescript"
],
"parserOptions": {
"ecmaVersion": "latest"
},
"rules": {
/* ================ linting ================ */
// disables the no-unused-vars rule
"no-unused-vars": [
"off"
],
// forces the use of const or let instead of var
"no-var": [
"error"
],
/* ================ formatting ================ */
// use 2 spaces for indentation
"indent": [
"error",
2
],
// use double quotes
"quotes": [
"error",
"single"
],
// dont move comma to new line
"comma-dangle": [
"error",
"never"
],
// use unix linebreaks
"linebreak-style": [
"error",
"unix"
],
// add a space before and after brackets
"array-bracket-spacing": [
"error",
"always"
],
// adds a space before and after curly braces
"object-curly-spacing": [
"error",
"always"
],
// moves the dot before a function call to the next line
"newline-per-chained-call": [
"error",
{
"ignoreChainWithDepth": 2
}
],
// ensures that functions are defined before they are used
"func-style": [
"error",
"declaration",
{
"allowArrowFunctions": true
}
],
// new line for ternary operator
"multiline-ternary": [
"error",
"always-multiline"
],
// new line for operators
"operator-linebreak": [
"error",
"none",
{
"overrides": {
"?": "before",
":": "before",
"||": "after",
"&&": "after"
}
}
],
// new line for function arguments
"function-call-argument-newline": [
"error",
"consistent"
]
},
// rules for .vue files
"overrides": [
{
"files": [
"*.vue"
],
"rules": {
// only one attribute per line
"vue/max-attributes-per-line": [
"error",
{
"singleline": {
"max": 1
},
"multiline": {
"max": 1
}
}
],
// first attribute on the line below opening tag
"vue/first-attribute-linebreak": [
"error",
{
"singleline": "beside",
"multiline": "below"
}
],
// closing tag on the same line as the last attribute
"vue/html-closing-bracket-newline": [
"error",
{
"singleline": "never",
"multiline": "never"
}
],
// disable multi-word component names
"vue/multi-word-component-names": [
"off"
],
// use kebab-case for component names
"vue/component-name-in-template-casing": [
"error",
"kebab-case"
],
// indent template
"vue/html-indent": [
"error",
2
]
}
}
]
}