-
Notifications
You must be signed in to change notification settings - Fork 6
/
.eslintrc.js
132 lines (92 loc) · 3.46 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
// eslint-disable-next-line no-undef
module.exports = {
env: {
browser: true,
es2021: true,
},
extends: [
"eslint:recommended",
"plugin:vue/strongly-recommended",
"plugin:cypress/recommended"
],
// Known globals
globals: {
$nuxt: true,
// 'structuredClone' is available as of ES6 (ca. 2015), but ESLint does not yet know about it
structuredClone: true,
// Currently for Cypress plugins in support js files (see cypress/e2e/support.js)
require: true
},
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
plugins: [
"vue",
"cypress"
],
rules: {
semi: "error",
// Tags ===============================================================
"vue/max-attributes-per-line": [ "error", {
// Maximum number of attributes on a single line opening tag
"singleline": {
"max": 4
}
}],
"vue/html-closing-bracket-newline": [ "warn", {
// Disallow line breaks before the closing bracket on a multiline opening tag, i.e. -
// Yes: <tagname
// attribute1=""
// attribute2="">
// No : <tagname
// attribute1=""
// attribute2=""
// >
multiline: "never"
}],
"vue/html-self-closing": ["warn", {
"html": {
"void": "always"
}
}],
// Variables ==========================================================
"no-unused-vars": [ "warn", {
// Do not check for unused variables in argument lists
args: "none"
}],
"vue/no-unused-vars": [ "warn", {
// Ignore unused variables beginning with '_' character
// (Currently just used for unused variables in v-for statements)
"ignorePattern": "^_"
}],
// Script =============================================================
// No trailing commas
"comma-dangle": ["error", "never"],
// Comma spacing in arrays and objects
"comma-spacing": ["error", { "before": false, "after": true }],
// Whitespace =========================================================
// Trailing whitespace only allowed in comments (specifically for comment block)
"no-trailing-spaces": ["error", { "skipBlankLines": false, "ignoreComments": false }],
// Four-space indentation for html tags in template portion of vue file
"vue/html-indent": [ "warn", 4, {
// Attributes do not have to be aligned vertically
alignAttributesVertically: false
}],
"vue/multiline-html-element-content-newline": [ "warn", {
// Allows blank lines around multiline tags
allowEmptyLines: true
}],
"vue/multi-word-component-names": ["error", {
// Ignore the single-word name for Nuxt's default layout
"ignores": ["DefaultLayout"]
}],
// Four space indent for script portion of vue file
"vue/script-indent": ["error", 4, {
// First indentation for top-level statements is 1 indent
"baseIndent": 1,
// First indentation for case/default statements inside a switch is 1 indent
"switchCase": 1
}]
}
};