@lenne.tech/eslint-config-vue 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +295 -0
- package/package.json +31 -0
package/index.js
ADDED
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
console.log("Linting Vue...");
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
overrides: [
|
|
5
|
+
{
|
|
6
|
+
files: ["*.vue"],
|
|
7
|
+
parser: "vue-eslint-parser",
|
|
8
|
+
parserOptions: {
|
|
9
|
+
parser: "@typescript-eslint/parser",
|
|
10
|
+
},
|
|
11
|
+
rules: {
|
|
12
|
+
"no-unused-vars": "off",
|
|
13
|
+
"no-undef": "off",
|
|
14
|
+
"@typescript-eslint/no-unused-vars": "off",
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
ignorePatterns: ["**/*.js"],
|
|
19
|
+
extends: [
|
|
20
|
+
"plugin:vue/vue3-recommended",
|
|
21
|
+
"plugin:import/typescript",
|
|
22
|
+
"plugin:@typescript-eslint/recommended",
|
|
23
|
+
],
|
|
24
|
+
plugins: ["vitest"],
|
|
25
|
+
rules: {
|
|
26
|
+
"vue/max-attributes-per-line": "off",
|
|
27
|
+
"vue/no-v-html": "off",
|
|
28
|
+
"vue/require-prop-types": "off",
|
|
29
|
+
"vue/require-default-prop": "off",
|
|
30
|
+
"vue/multi-word-component-names": "off",
|
|
31
|
+
"vue/prefer-import-from-vue": "off",
|
|
32
|
+
"vue/no-v-text-v-html-on-component": "off",
|
|
33
|
+
"vue/no-dupe-keys": "off",
|
|
34
|
+
|
|
35
|
+
// reactivity transform
|
|
36
|
+
"vue/no-setup-props-destructure": "off",
|
|
37
|
+
"vue/component-tags-order": [
|
|
38
|
+
"error",
|
|
39
|
+
{
|
|
40
|
+
order: ["script", "template", "style"],
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
"vue/block-tag-newline": [
|
|
44
|
+
"error",
|
|
45
|
+
{
|
|
46
|
+
singleline: "always",
|
|
47
|
+
multiline: "always",
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
"vue/component-name-in-template-casing": ["error", "PascalCase"],
|
|
51
|
+
"vue/component-options-name-casing": ["error", "PascalCase"],
|
|
52
|
+
"vue/custom-event-name-casing": ["error", "camelCase"],
|
|
53
|
+
"vue/define-macros-order": [
|
|
54
|
+
"error",
|
|
55
|
+
{
|
|
56
|
+
order: ["defineOptions", "defineProps", "defineEmits", "defineSlots"],
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
"vue/html-comment-content-spacing": [
|
|
60
|
+
"error",
|
|
61
|
+
"always",
|
|
62
|
+
{
|
|
63
|
+
exceptions: ["-"],
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
"vue/no-restricted-v-bind": ["error", "/^v-/"],
|
|
67
|
+
"vue/no-useless-v-bind": "error",
|
|
68
|
+
"vue/no-unused-refs": "error",
|
|
69
|
+
"vue/padding-line-between-blocks": ["error", "always"],
|
|
70
|
+
"vue/prefer-separate-static-class": "error",
|
|
71
|
+
|
|
72
|
+
// extensions
|
|
73
|
+
"vue/array-bracket-spacing": ["error", "never"],
|
|
74
|
+
"vue/arrow-spacing": ["error", { before: true, after: true }],
|
|
75
|
+
"vue/block-spacing": ["error", "always"],
|
|
76
|
+
"vue/brace-style": ["error", "stroustrup", { allowSingleLine: true }],
|
|
77
|
+
"vue/comma-dangle": ["error", "always-multiline"],
|
|
78
|
+
"vue/comma-spacing": ["error", { before: false, after: true }],
|
|
79
|
+
"vue/comma-style": ["error", "last"],
|
|
80
|
+
"vue/dot-location": ["error", "property"],
|
|
81
|
+
"vue/dot-notation": ["error", { allowKeywords: true }],
|
|
82
|
+
"vue/eqeqeq": ["error", "smart"],
|
|
83
|
+
// 'vue/func-call-spacing': ['off', 'never'],
|
|
84
|
+
"vue/key-spacing": ["error", { beforeColon: false, afterColon: true }],
|
|
85
|
+
"vue/keyword-spacing": ["error", { before: true, after: true }],
|
|
86
|
+
"vue/no-constant-condition": "warn",
|
|
87
|
+
"vue/no-empty-pattern": "error",
|
|
88
|
+
"vue/no-extra-parens": ["error", "functions"],
|
|
89
|
+
"vue/no-irregular-whitespace": "error",
|
|
90
|
+
"vue/no-loss-of-precision": "error",
|
|
91
|
+
"vue/no-restricted-syntax": [
|
|
92
|
+
"error",
|
|
93
|
+
"DebuggerStatement",
|
|
94
|
+
"LabeledStatement",
|
|
95
|
+
"WithStatement",
|
|
96
|
+
],
|
|
97
|
+
"vue/no-sparse-arrays": "error",
|
|
98
|
+
"vue/object-curly-newline": [
|
|
99
|
+
"error",
|
|
100
|
+
{ multiline: true, consistent: true },
|
|
101
|
+
],
|
|
102
|
+
"vue/object-curly-spacing": ["error", "always"],
|
|
103
|
+
"vue/object-property-newline": [
|
|
104
|
+
"error",
|
|
105
|
+
{ allowMultiplePropertiesPerLine: true },
|
|
106
|
+
],
|
|
107
|
+
"vue/object-shorthand": [
|
|
108
|
+
"error",
|
|
109
|
+
"always",
|
|
110
|
+
{
|
|
111
|
+
ignoreConstructors: false,
|
|
112
|
+
avoidQuotes: true,
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
"vue/operator-linebreak": ["error", "before"],
|
|
116
|
+
"vue/prefer-template": "error",
|
|
117
|
+
"vue/quote-props": ["error", "consistent-as-needed"],
|
|
118
|
+
"vue/space-in-parens": ["error", "never"],
|
|
119
|
+
"vue/space-infix-ops": "error",
|
|
120
|
+
"vue/space-unary-ops": ["error", { words: true, nonwords: false }],
|
|
121
|
+
"vue/template-curly-spacing": "error",
|
|
122
|
+
"vue/html-self-closing": [
|
|
123
|
+
"error",
|
|
124
|
+
{
|
|
125
|
+
html: {
|
|
126
|
+
void: "always",
|
|
127
|
+
normal: "always",
|
|
128
|
+
component: "always",
|
|
129
|
+
},
|
|
130
|
+
svg: "always",
|
|
131
|
+
math: "always",
|
|
132
|
+
},
|
|
133
|
+
],
|
|
134
|
+
|
|
135
|
+
"vue/attributes-order": [
|
|
136
|
+
"error",
|
|
137
|
+
{
|
|
138
|
+
order: [
|
|
139
|
+
"DEFINITION",
|
|
140
|
+
"LIST_RENDERING",
|
|
141
|
+
"CONDITIONALS",
|
|
142
|
+
"RENDER_MODIFIERS",
|
|
143
|
+
"GLOBAL",
|
|
144
|
+
["UNIQUE", "SLOT"],
|
|
145
|
+
"TWO_WAY_BINDING",
|
|
146
|
+
"OTHER_DIRECTIVES",
|
|
147
|
+
"OTHER_ATTR",
|
|
148
|
+
"EVENTS",
|
|
149
|
+
"CONTENT",
|
|
150
|
+
],
|
|
151
|
+
alphabetical: false,
|
|
152
|
+
},
|
|
153
|
+
],
|
|
154
|
+
|
|
155
|
+
/*
|
|
156
|
+
TypeScript
|
|
157
|
+
*/
|
|
158
|
+
|
|
159
|
+
"import/named": "off",
|
|
160
|
+
|
|
161
|
+
// TS
|
|
162
|
+
"@typescript-eslint/ban-ts-comment": [
|
|
163
|
+
"error",
|
|
164
|
+
{ "ts-ignore": "allow-with-description" },
|
|
165
|
+
],
|
|
166
|
+
"@typescript-eslint/member-delimiter-style": [
|
|
167
|
+
"error",
|
|
168
|
+
{ multiline: { delimiter: "semi" } },
|
|
169
|
+
],
|
|
170
|
+
"@typescript-eslint/type-annotation-spacing": ["error", {}],
|
|
171
|
+
"@typescript-eslint/consistent-type-imports": [
|
|
172
|
+
"error",
|
|
173
|
+
{ prefer: "type-imports", disallowTypeAnnotations: false },
|
|
174
|
+
],
|
|
175
|
+
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
|
|
176
|
+
"@typescript-eslint/prefer-ts-expect-error": "error",
|
|
177
|
+
"@typescript-eslint/no-require-imports": "error",
|
|
178
|
+
// Override JS
|
|
179
|
+
"no-useless-constructor": "off",
|
|
180
|
+
indent: "off",
|
|
181
|
+
"@typescript-eslint/indent": [
|
|
182
|
+
"error",
|
|
183
|
+
2,
|
|
184
|
+
{
|
|
185
|
+
SwitchCase: 1,
|
|
186
|
+
VariableDeclarator: 1,
|
|
187
|
+
outerIIFEBody: 1,
|
|
188
|
+
MemberExpression: 1,
|
|
189
|
+
FunctionDeclaration: { parameters: 1, body: 1 },
|
|
190
|
+
FunctionExpression: { parameters: 1, body: 1 },
|
|
191
|
+
CallExpression: { arguments: 1 },
|
|
192
|
+
ArrayExpression: 1,
|
|
193
|
+
ObjectExpression: 1,
|
|
194
|
+
ImportDeclaration: 1,
|
|
195
|
+
flatTernaryExpressions: false,
|
|
196
|
+
ignoreComments: false,
|
|
197
|
+
ignoredNodes: [
|
|
198
|
+
"TemplateLiteral *",
|
|
199
|
+
"JSXElement",
|
|
200
|
+
"JSXElement > *",
|
|
201
|
+
"JSXAttribute",
|
|
202
|
+
"JSXIdentifier",
|
|
203
|
+
"JSXNamespacedName",
|
|
204
|
+
"JSXMemberExpression",
|
|
205
|
+
"JSXSpreadAttribute",
|
|
206
|
+
"JSXExpressionContainer",
|
|
207
|
+
"JSXOpeningElement",
|
|
208
|
+
"JSXClosingElement",
|
|
209
|
+
"JSXFragment",
|
|
210
|
+
"JSXOpeningFragment",
|
|
211
|
+
"JSXClosingFragment",
|
|
212
|
+
"JSXText",
|
|
213
|
+
"JSXEmptyExpression",
|
|
214
|
+
"JSXSpreadChild",
|
|
215
|
+
"TSTypeParameterInstantiation",
|
|
216
|
+
"FunctionExpression > .params[decorators.length > 0]",
|
|
217
|
+
"FunctionExpression > .params > :matches(Decorator, :not(:first-child))",
|
|
218
|
+
"ClassBody.body > PropertyDefinition[decorators.length > 0] > .key",
|
|
219
|
+
],
|
|
220
|
+
offsetTernaryExpressions: true,
|
|
221
|
+
},
|
|
222
|
+
],
|
|
223
|
+
"no-invalid-this": "off",
|
|
224
|
+
"@typescript-eslint/no-invalid-this": "error",
|
|
225
|
+
"no-redeclare": "off",
|
|
226
|
+
"@typescript-eslint/no-redeclare": "error",
|
|
227
|
+
"no-use-before-define": "off",
|
|
228
|
+
"@typescript-eslint/no-use-before-define": [
|
|
229
|
+
"error",
|
|
230
|
+
{ functions: false, classes: false, variables: true },
|
|
231
|
+
],
|
|
232
|
+
"brace-style": "off",
|
|
233
|
+
"comma-dangle": "off",
|
|
234
|
+
"@typescript-eslint/comma-dangle": ["error", "always-multiline"],
|
|
235
|
+
"object-curly-spacing": "off",
|
|
236
|
+
"@typescript-eslint/object-curly-spacing": ["error", "always"],
|
|
237
|
+
semi: "off",
|
|
238
|
+
"@typescript-eslint/semi": ["error"],
|
|
239
|
+
quotes: "off",
|
|
240
|
+
"@typescript-eslint/quotes": ["error", "single"],
|
|
241
|
+
"space-before-blocks": "off",
|
|
242
|
+
"@typescript-eslint/space-before-blocks": ["error", "always"],
|
|
243
|
+
"space-before-function-paren": "off",
|
|
244
|
+
"@typescript-eslint/space-before-function-paren": [
|
|
245
|
+
"error",
|
|
246
|
+
{
|
|
247
|
+
anonymous: "always",
|
|
248
|
+
named: "never",
|
|
249
|
+
asyncArrow: "always",
|
|
250
|
+
},
|
|
251
|
+
],
|
|
252
|
+
"space-infix-ops": "off",
|
|
253
|
+
"@typescript-eslint/space-infix-ops": "error",
|
|
254
|
+
"keyword-spacing": "off",
|
|
255
|
+
"@typescript-eslint/keyword-spacing": [
|
|
256
|
+
"error",
|
|
257
|
+
{ before: true, after: true },
|
|
258
|
+
],
|
|
259
|
+
"comma-spacing": "off",
|
|
260
|
+
"@typescript-eslint/comma-spacing": [
|
|
261
|
+
"error",
|
|
262
|
+
{ before: false, after: true },
|
|
263
|
+
],
|
|
264
|
+
"no-extra-parens": "off",
|
|
265
|
+
"@typescript-eslint/no-extra-parens": ["error", "functions"],
|
|
266
|
+
"no-dupe-class-members": "off",
|
|
267
|
+
"@typescript-eslint/no-dupe-class-members": "error",
|
|
268
|
+
"no-loss-of-precision": "off",
|
|
269
|
+
"@typescript-eslint/no-loss-of-precision": "error",
|
|
270
|
+
"lines-between-class-members": "off",
|
|
271
|
+
"@typescript-eslint/lines-between-class-members": [
|
|
272
|
+
"error",
|
|
273
|
+
"always",
|
|
274
|
+
{ exceptAfterSingleLine: true },
|
|
275
|
+
],
|
|
276
|
+
"no-console": ["error", { allow: ["info", "debug", "warn", "error"] }],
|
|
277
|
+
|
|
278
|
+
// off
|
|
279
|
+
"@typescript-eslint/consistent-indexed-object-style": "off",
|
|
280
|
+
"@typescript-eslint/naming-convention": "off",
|
|
281
|
+
"@typescript-eslint/explicit-function-return-type": "off",
|
|
282
|
+
"@typescript-eslint/explicit-member-accessibility": "off",
|
|
283
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
284
|
+
"@typescript-eslint/parameter-properties": "off",
|
|
285
|
+
"@typescript-eslint/interface-name-prefix": "off",
|
|
286
|
+
"@typescript-eslint/no-empty-interface": "off",
|
|
287
|
+
"@typescript-eslint/ban-ts-ignore": "off",
|
|
288
|
+
"@typescript-eslint/no-empty-function": "off",
|
|
289
|
+
"@typescript-eslint/no-non-null-assertion": "off",
|
|
290
|
+
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
291
|
+
"@typescript-eslint/ban-types": "off",
|
|
292
|
+
"@typescript-eslint/triple-slash-reference": "off",
|
|
293
|
+
"@typescript-eslint/no-unused-vars": "off",
|
|
294
|
+
},
|
|
295
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@lenne.tech/eslint-config-vue",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"description": "ESLint config of lenne.Tech for Vue",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"eslint-config-vue"
|
|
8
|
+
],
|
|
9
|
+
"main": "index.js",
|
|
10
|
+
"files": [
|
|
11
|
+
"index.js"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"watch": "watch 'yalc push --private'"
|
|
15
|
+
},
|
|
16
|
+
"peerDependencies": {
|
|
17
|
+
"eslint": ">=7.4.0"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@typescript-eslint/eslint-plugin": "5.60.1",
|
|
21
|
+
"eslint-plugin-import": "2.27.5",
|
|
22
|
+
"eslint-plugin-vue": "9.15.1",
|
|
23
|
+
"eslint-plugin-vitest": "0.0.57",
|
|
24
|
+
"eslint-config-prettier": "8.8.0"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@nuxtjs/eslint-config-typescript": "12.0.0",
|
|
28
|
+
"eslint": "8.41.0",
|
|
29
|
+
"watch": "1.0.2"
|
|
30
|
+
}
|
|
31
|
+
}
|