@kouts/eslint-config 1.2.0 → 1.3.1
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/README.md +5 -2
- package/package.json +14 -5
- package/dist/index.cjs +0 -531
- package/dist/index.d.cts +0 -11
- package/dist/index.d.ts +0 -11
- package/dist/index.js +0 -526
- package/dist/prettier.cjs +0 -12
- package/dist/prettier.d.cts +0 -5
- package/dist/prettier.d.ts +0 -5
- package/dist/prettier.js +0 -10
package/README.md
CHANGED
|
@@ -40,9 +40,10 @@ The configuration comes with default settings that extend the [neostandard confi
|
|
|
40
40
|
| ts | `boolean` | Enable TypeScript support | `true` |
|
|
41
41
|
| noJsx | `boolean` | No jsx rules will be added | `true` |
|
|
42
42
|
| noStyle | `boolean` | No style rules will be added | `true` |
|
|
43
|
-
| semi | `boolean` | No
|
|
43
|
+
| semi | `boolean` | No semicolons | `false` |
|
|
44
44
|
| vue | `boolean` | Enable Vue.js support | `true` |
|
|
45
45
|
| vueVersion | `2` or `3` | Specify the version of Vue.js | `3` |
|
|
46
|
+
| vitest | `boolean` | Enable Vitest support | `true` |
|
|
46
47
|
|
|
47
48
|
**Example:**
|
|
48
49
|
|
|
@@ -50,7 +51,8 @@ The configuration comes with default settings that extend the [neostandard confi
|
|
|
50
51
|
config({
|
|
51
52
|
ts: false,
|
|
52
53
|
vue: true
|
|
53
|
-
vueVersion: 3
|
|
54
|
+
vueVersion: 3,
|
|
55
|
+
vitest: false,
|
|
54
56
|
})
|
|
55
57
|
```
|
|
56
58
|
|
|
@@ -107,6 +109,7 @@ Ad the following settings to your VS Code project settings for autofix on save:
|
|
|
107
109
|
- [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier) for using Prettier as a code formatter with `eslint --fix`
|
|
108
110
|
- [eslint-plugin-simple-import-sort](https://github.com/lydell/eslint-plugin-simple-import-sort) for auto-fixing imports order
|
|
109
111
|
- [eslint-plugin-import-x](https://github.com/lydell/eslint-plugin-simple-import-sort) for auto-fixing import/export syntax, and prevent issues with misspelling of file paths and import names
|
|
112
|
+
- [eslint-plugin-vitest](https://github.com/vitest-dev/eslint-plugin-vitest) for linting Vitest test files
|
|
110
113
|
|
|
111
114
|
## License
|
|
112
115
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kouts/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.3.1",
|
|
5
5
|
"packageManager": "pnpm@9.7.1",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
|
@@ -47,7 +47,8 @@
|
|
|
47
47
|
"inspect": "npx @eslint/config-inspector --config eslint.config.ts",
|
|
48
48
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
49
49
|
"lint": "pnpm run build && eslint .",
|
|
50
|
-
"lint-fix": "pnpm run build && eslint --fix ."
|
|
50
|
+
"lint-fix": "pnpm run build && eslint --fix .",
|
|
51
|
+
"prepare": "husky"
|
|
51
52
|
},
|
|
52
53
|
"keywords": [
|
|
53
54
|
"lint",
|
|
@@ -68,6 +69,7 @@
|
|
|
68
69
|
"url": "git+https://github.com/kouts/eslint-config.git"
|
|
69
70
|
},
|
|
70
71
|
"dependencies": {
|
|
72
|
+
"@vitest/eslint-plugin": "^1.0.3",
|
|
71
73
|
"eslint-config-prettier": "^9.1.0",
|
|
72
74
|
"eslint-plugin-html": "^8.1.1",
|
|
73
75
|
"eslint-plugin-import-x": "^3.1.0",
|
|
@@ -78,15 +80,22 @@
|
|
|
78
80
|
"prettier": "^3.3.3"
|
|
79
81
|
},
|
|
80
82
|
"devDependencies": {
|
|
81
|
-
"@
|
|
83
|
+
"@commitlint/cli": "^19.4.0",
|
|
84
|
+
"@commitlint/config-conventional": "^19.2.2",
|
|
85
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
86
|
+
"@semantic-release/git": "^10.0.1",
|
|
87
|
+
"@types/node": "^22.4.0",
|
|
82
88
|
"eslint": "^9.9.0",
|
|
89
|
+
"husky": "^9.1.4",
|
|
90
|
+
"lint-staged": "^15.2.9",
|
|
83
91
|
"pkgroll": "^2.4.2",
|
|
92
|
+
"semantic-release": "^24.1.0",
|
|
84
93
|
"typescript": "^5.5.4"
|
|
85
94
|
},
|
|
86
95
|
"peerDependencies": {
|
|
87
96
|
"eslint": "^9.8.0"
|
|
88
97
|
},
|
|
89
98
|
"resolutions": {
|
|
90
|
-
"@typescript-eslint/utils": "^8.
|
|
99
|
+
"@typescript-eslint/utils": "^8.1.0"
|
|
91
100
|
}
|
|
92
|
-
}
|
|
101
|
+
}
|
package/dist/index.cjs
DELETED
|
@@ -1,531 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var pluginHtml = require('eslint-plugin-html');
|
|
4
|
-
var pluginImport = require('eslint-plugin-import-x');
|
|
5
|
-
var pluginPrettier = require('eslint-plugin-prettier/recommended');
|
|
6
|
-
var pluginSimpleImportSort = require('eslint-plugin-simple-import-sort');
|
|
7
|
-
var neostandard = require('neostandard');
|
|
8
|
-
var pluginVue = require('eslint-plugin-vue');
|
|
9
|
-
|
|
10
|
-
function getDefaultExportFromCjs (x) {
|
|
11
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/*
|
|
15
|
-
* WARNING: This file is autogenerated using the tools/update-eslint-all.js
|
|
16
|
-
* script. Do not edit manually.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
/* eslint quote-props: off -- autogenerated so don't lint */
|
|
20
|
-
|
|
21
|
-
/*
|
|
22
|
-
* IMPORTANT!
|
|
23
|
-
*
|
|
24
|
-
* We cannot add a "name" property to this object because it's still used in eslintrc
|
|
25
|
-
* which doesn't support the "name" property. If we add a "name" property, it will
|
|
26
|
-
* cause an error.
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
var eslintAll = Object.freeze({
|
|
30
|
-
"rules": {
|
|
31
|
-
"accessor-pairs": "error",
|
|
32
|
-
"array-callback-return": "error",
|
|
33
|
-
"arrow-body-style": "error",
|
|
34
|
-
"block-scoped-var": "error",
|
|
35
|
-
"camelcase": "error",
|
|
36
|
-
"capitalized-comments": "error",
|
|
37
|
-
"class-methods-use-this": "error",
|
|
38
|
-
"complexity": "error",
|
|
39
|
-
"consistent-return": "error",
|
|
40
|
-
"consistent-this": "error",
|
|
41
|
-
"constructor-super": "error",
|
|
42
|
-
"curly": "error",
|
|
43
|
-
"default-case": "error",
|
|
44
|
-
"default-case-last": "error",
|
|
45
|
-
"default-param-last": "error",
|
|
46
|
-
"dot-notation": "error",
|
|
47
|
-
"eqeqeq": "error",
|
|
48
|
-
"for-direction": "error",
|
|
49
|
-
"func-name-matching": "error",
|
|
50
|
-
"func-names": "error",
|
|
51
|
-
"func-style": "error",
|
|
52
|
-
"getter-return": "error",
|
|
53
|
-
"grouped-accessor-pairs": "error",
|
|
54
|
-
"guard-for-in": "error",
|
|
55
|
-
"id-denylist": "error",
|
|
56
|
-
"id-length": "error",
|
|
57
|
-
"id-match": "error",
|
|
58
|
-
"init-declarations": "error",
|
|
59
|
-
"logical-assignment-operators": "error",
|
|
60
|
-
"max-classes-per-file": "error",
|
|
61
|
-
"max-depth": "error",
|
|
62
|
-
"max-lines": "error",
|
|
63
|
-
"max-lines-per-function": "error",
|
|
64
|
-
"max-nested-callbacks": "error",
|
|
65
|
-
"max-params": "error",
|
|
66
|
-
"max-statements": "error",
|
|
67
|
-
"new-cap": "error",
|
|
68
|
-
"no-alert": "error",
|
|
69
|
-
"no-array-constructor": "error",
|
|
70
|
-
"no-async-promise-executor": "error",
|
|
71
|
-
"no-await-in-loop": "error",
|
|
72
|
-
"no-bitwise": "error",
|
|
73
|
-
"no-caller": "error",
|
|
74
|
-
"no-case-declarations": "error",
|
|
75
|
-
"no-class-assign": "error",
|
|
76
|
-
"no-compare-neg-zero": "error",
|
|
77
|
-
"no-cond-assign": "error",
|
|
78
|
-
"no-console": "error",
|
|
79
|
-
"no-const-assign": "error",
|
|
80
|
-
"no-constant-binary-expression": "error",
|
|
81
|
-
"no-constant-condition": "error",
|
|
82
|
-
"no-constructor-return": "error",
|
|
83
|
-
"no-continue": "error",
|
|
84
|
-
"no-control-regex": "error",
|
|
85
|
-
"no-debugger": "error",
|
|
86
|
-
"no-delete-var": "error",
|
|
87
|
-
"no-div-regex": "error",
|
|
88
|
-
"no-dupe-args": "error",
|
|
89
|
-
"no-dupe-class-members": "error",
|
|
90
|
-
"no-dupe-else-if": "error",
|
|
91
|
-
"no-dupe-keys": "error",
|
|
92
|
-
"no-duplicate-case": "error",
|
|
93
|
-
"no-duplicate-imports": "error",
|
|
94
|
-
"no-else-return": "error",
|
|
95
|
-
"no-empty": "error",
|
|
96
|
-
"no-empty-character-class": "error",
|
|
97
|
-
"no-empty-function": "error",
|
|
98
|
-
"no-empty-pattern": "error",
|
|
99
|
-
"no-empty-static-block": "error",
|
|
100
|
-
"no-eq-null": "error",
|
|
101
|
-
"no-eval": "error",
|
|
102
|
-
"no-ex-assign": "error",
|
|
103
|
-
"no-extend-native": "error",
|
|
104
|
-
"no-extra-bind": "error",
|
|
105
|
-
"no-extra-boolean-cast": "error",
|
|
106
|
-
"no-extra-label": "error",
|
|
107
|
-
"no-fallthrough": "error",
|
|
108
|
-
"no-func-assign": "error",
|
|
109
|
-
"no-global-assign": "error",
|
|
110
|
-
"no-implicit-coercion": "error",
|
|
111
|
-
"no-implicit-globals": "error",
|
|
112
|
-
"no-implied-eval": "error",
|
|
113
|
-
"no-import-assign": "error",
|
|
114
|
-
"no-inline-comments": "error",
|
|
115
|
-
"no-inner-declarations": "error",
|
|
116
|
-
"no-invalid-regexp": "error",
|
|
117
|
-
"no-invalid-this": "error",
|
|
118
|
-
"no-irregular-whitespace": "error",
|
|
119
|
-
"no-iterator": "error",
|
|
120
|
-
"no-label-var": "error",
|
|
121
|
-
"no-labels": "error",
|
|
122
|
-
"no-lone-blocks": "error",
|
|
123
|
-
"no-lonely-if": "error",
|
|
124
|
-
"no-loop-func": "error",
|
|
125
|
-
"no-loss-of-precision": "error",
|
|
126
|
-
"no-magic-numbers": "error",
|
|
127
|
-
"no-misleading-character-class": "error",
|
|
128
|
-
"no-multi-assign": "error",
|
|
129
|
-
"no-multi-str": "error",
|
|
130
|
-
"no-negated-condition": "error",
|
|
131
|
-
"no-nested-ternary": "error",
|
|
132
|
-
"no-new": "error",
|
|
133
|
-
"no-new-func": "error",
|
|
134
|
-
"no-new-native-nonconstructor": "error",
|
|
135
|
-
"no-new-wrappers": "error",
|
|
136
|
-
"no-nonoctal-decimal-escape": "error",
|
|
137
|
-
"no-obj-calls": "error",
|
|
138
|
-
"no-object-constructor": "error",
|
|
139
|
-
"no-octal": "error",
|
|
140
|
-
"no-octal-escape": "error",
|
|
141
|
-
"no-param-reassign": "error",
|
|
142
|
-
"no-plusplus": "error",
|
|
143
|
-
"no-promise-executor-return": "error",
|
|
144
|
-
"no-proto": "error",
|
|
145
|
-
"no-prototype-builtins": "error",
|
|
146
|
-
"no-redeclare": "error",
|
|
147
|
-
"no-regex-spaces": "error",
|
|
148
|
-
"no-restricted-exports": "error",
|
|
149
|
-
"no-restricted-globals": "error",
|
|
150
|
-
"no-restricted-imports": "error",
|
|
151
|
-
"no-restricted-properties": "error",
|
|
152
|
-
"no-restricted-syntax": "error",
|
|
153
|
-
"no-return-assign": "error",
|
|
154
|
-
"no-script-url": "error",
|
|
155
|
-
"no-self-assign": "error",
|
|
156
|
-
"no-self-compare": "error",
|
|
157
|
-
"no-sequences": "error",
|
|
158
|
-
"no-setter-return": "error",
|
|
159
|
-
"no-shadow": "error",
|
|
160
|
-
"no-shadow-restricted-names": "error",
|
|
161
|
-
"no-sparse-arrays": "error",
|
|
162
|
-
"no-template-curly-in-string": "error",
|
|
163
|
-
"no-ternary": "error",
|
|
164
|
-
"no-this-before-super": "error",
|
|
165
|
-
"no-throw-literal": "error",
|
|
166
|
-
"no-undef": "error",
|
|
167
|
-
"no-undef-init": "error",
|
|
168
|
-
"no-undefined": "error",
|
|
169
|
-
"no-underscore-dangle": "error",
|
|
170
|
-
"no-unexpected-multiline": "error",
|
|
171
|
-
"no-unmodified-loop-condition": "error",
|
|
172
|
-
"no-unneeded-ternary": "error",
|
|
173
|
-
"no-unreachable": "error",
|
|
174
|
-
"no-unreachable-loop": "error",
|
|
175
|
-
"no-unsafe-finally": "error",
|
|
176
|
-
"no-unsafe-negation": "error",
|
|
177
|
-
"no-unsafe-optional-chaining": "error",
|
|
178
|
-
"no-unused-expressions": "error",
|
|
179
|
-
"no-unused-labels": "error",
|
|
180
|
-
"no-unused-private-class-members": "error",
|
|
181
|
-
"no-unused-vars": "error",
|
|
182
|
-
"no-use-before-define": "error",
|
|
183
|
-
"no-useless-assignment": "error",
|
|
184
|
-
"no-useless-backreference": "error",
|
|
185
|
-
"no-useless-call": "error",
|
|
186
|
-
"no-useless-catch": "error",
|
|
187
|
-
"no-useless-computed-key": "error",
|
|
188
|
-
"no-useless-concat": "error",
|
|
189
|
-
"no-useless-constructor": "error",
|
|
190
|
-
"no-useless-escape": "error",
|
|
191
|
-
"no-useless-rename": "error",
|
|
192
|
-
"no-useless-return": "error",
|
|
193
|
-
"no-var": "error",
|
|
194
|
-
"no-void": "error",
|
|
195
|
-
"no-warning-comments": "error",
|
|
196
|
-
"no-with": "error",
|
|
197
|
-
"object-shorthand": "error",
|
|
198
|
-
"one-var": "error",
|
|
199
|
-
"operator-assignment": "error",
|
|
200
|
-
"prefer-arrow-callback": "error",
|
|
201
|
-
"prefer-const": "error",
|
|
202
|
-
"prefer-destructuring": "error",
|
|
203
|
-
"prefer-exponentiation-operator": "error",
|
|
204
|
-
"prefer-named-capture-group": "error",
|
|
205
|
-
"prefer-numeric-literals": "error",
|
|
206
|
-
"prefer-object-has-own": "error",
|
|
207
|
-
"prefer-object-spread": "error",
|
|
208
|
-
"prefer-promise-reject-errors": "error",
|
|
209
|
-
"prefer-regex-literals": "error",
|
|
210
|
-
"prefer-rest-params": "error",
|
|
211
|
-
"prefer-spread": "error",
|
|
212
|
-
"prefer-template": "error",
|
|
213
|
-
"radix": "error",
|
|
214
|
-
"require-atomic-updates": "error",
|
|
215
|
-
"require-await": "error",
|
|
216
|
-
"require-unicode-regexp": "error",
|
|
217
|
-
"require-yield": "error",
|
|
218
|
-
"sort-imports": "error",
|
|
219
|
-
"sort-keys": "error",
|
|
220
|
-
"sort-vars": "error",
|
|
221
|
-
"strict": "error",
|
|
222
|
-
"symbol-description": "error",
|
|
223
|
-
"unicode-bom": "error",
|
|
224
|
-
"use-isnan": "error",
|
|
225
|
-
"valid-typeof": "error",
|
|
226
|
-
"vars-on-top": "error",
|
|
227
|
-
"yoda": "error"
|
|
228
|
-
}
|
|
229
|
-
});
|
|
230
|
-
|
|
231
|
-
/**
|
|
232
|
-
* @fileoverview Configuration applied when a user configuration extends from
|
|
233
|
-
* eslint:recommended.
|
|
234
|
-
* @author Nicholas C. Zakas
|
|
235
|
-
*/
|
|
236
|
-
|
|
237
|
-
/* eslint sort-keys: ["error", "asc"] -- Long, so make more readable */
|
|
238
|
-
|
|
239
|
-
/*
|
|
240
|
-
* IMPORTANT!
|
|
241
|
-
*
|
|
242
|
-
* We cannot add a "name" property to this object because it's still used in eslintrc
|
|
243
|
-
* which doesn't support the "name" property. If we add a "name" property, it will
|
|
244
|
-
* cause an error.
|
|
245
|
-
*/
|
|
246
|
-
|
|
247
|
-
var eslintRecommended = Object.freeze({
|
|
248
|
-
rules: Object.freeze({
|
|
249
|
-
"constructor-super": "error",
|
|
250
|
-
"for-direction": "error",
|
|
251
|
-
"getter-return": "error",
|
|
252
|
-
"no-async-promise-executor": "error",
|
|
253
|
-
"no-case-declarations": "error",
|
|
254
|
-
"no-class-assign": "error",
|
|
255
|
-
"no-compare-neg-zero": "error",
|
|
256
|
-
"no-cond-assign": "error",
|
|
257
|
-
"no-const-assign": "error",
|
|
258
|
-
"no-constant-binary-expression": "error",
|
|
259
|
-
"no-constant-condition": "error",
|
|
260
|
-
"no-control-regex": "error",
|
|
261
|
-
"no-debugger": "error",
|
|
262
|
-
"no-delete-var": "error",
|
|
263
|
-
"no-dupe-args": "error",
|
|
264
|
-
"no-dupe-class-members": "error",
|
|
265
|
-
"no-dupe-else-if": "error",
|
|
266
|
-
"no-dupe-keys": "error",
|
|
267
|
-
"no-duplicate-case": "error",
|
|
268
|
-
"no-empty": "error",
|
|
269
|
-
"no-empty-character-class": "error",
|
|
270
|
-
"no-empty-pattern": "error",
|
|
271
|
-
"no-empty-static-block": "error",
|
|
272
|
-
"no-ex-assign": "error",
|
|
273
|
-
"no-extra-boolean-cast": "error",
|
|
274
|
-
"no-fallthrough": "error",
|
|
275
|
-
"no-func-assign": "error",
|
|
276
|
-
"no-global-assign": "error",
|
|
277
|
-
"no-import-assign": "error",
|
|
278
|
-
"no-invalid-regexp": "error",
|
|
279
|
-
"no-irregular-whitespace": "error",
|
|
280
|
-
"no-loss-of-precision": "error",
|
|
281
|
-
"no-misleading-character-class": "error",
|
|
282
|
-
"no-new-native-nonconstructor": "error",
|
|
283
|
-
"no-nonoctal-decimal-escape": "error",
|
|
284
|
-
"no-obj-calls": "error",
|
|
285
|
-
"no-octal": "error",
|
|
286
|
-
"no-prototype-builtins": "error",
|
|
287
|
-
"no-redeclare": "error",
|
|
288
|
-
"no-regex-spaces": "error",
|
|
289
|
-
"no-self-assign": "error",
|
|
290
|
-
"no-setter-return": "error",
|
|
291
|
-
"no-shadow-restricted-names": "error",
|
|
292
|
-
"no-sparse-arrays": "error",
|
|
293
|
-
"no-this-before-super": "error",
|
|
294
|
-
"no-undef": "error",
|
|
295
|
-
"no-unexpected-multiline": "error",
|
|
296
|
-
"no-unreachable": "error",
|
|
297
|
-
"no-unsafe-finally": "error",
|
|
298
|
-
"no-unsafe-negation": "error",
|
|
299
|
-
"no-unsafe-optional-chaining": "error",
|
|
300
|
-
"no-unused-labels": "error",
|
|
301
|
-
"no-unused-private-class-members": "error",
|
|
302
|
-
"no-unused-vars": "error",
|
|
303
|
-
"no-useless-backreference": "error",
|
|
304
|
-
"no-useless-catch": "error",
|
|
305
|
-
"no-useless-escape": "error",
|
|
306
|
-
"no-with": "error",
|
|
307
|
-
"require-yield": "error",
|
|
308
|
-
"use-isnan": "error",
|
|
309
|
-
"valid-typeof": "error"
|
|
310
|
-
})
|
|
311
|
-
});
|
|
312
|
-
|
|
313
|
-
/**
|
|
314
|
-
* @fileoverview Main package entrypoint.
|
|
315
|
-
* @author Nicholas C. Zakas
|
|
316
|
-
*/
|
|
317
|
-
|
|
318
|
-
//------------------------------------------------------------------------------
|
|
319
|
-
// Public Interface
|
|
320
|
-
//------------------------------------------------------------------------------
|
|
321
|
-
|
|
322
|
-
var src = {
|
|
323
|
-
configs: {
|
|
324
|
-
all: eslintAll,
|
|
325
|
-
recommended: eslintRecommended
|
|
326
|
-
}
|
|
327
|
-
};
|
|
328
|
-
|
|
329
|
-
var js = /*@__PURE__*/getDefaultExportFromCjs(src);
|
|
330
|
-
|
|
331
|
-
const typescript = [
|
|
332
|
-
...neostandard.plugins["typescript-eslint"].configs.recommended,
|
|
333
|
-
{
|
|
334
|
-
name: "kouts/typescript",
|
|
335
|
-
rules: {
|
|
336
|
-
// Prefer T[] instead of Array<T>
|
|
337
|
-
"@typescript-eslint/array-type": ["error", { default: "array" }],
|
|
338
|
-
// Prefer type over interface for objects
|
|
339
|
-
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
|
|
340
|
-
// Fix type imports
|
|
341
|
-
"@typescript-eslint/consistent-type-imports": [
|
|
342
|
-
"error",
|
|
343
|
-
{
|
|
344
|
-
prefer: "type-imports",
|
|
345
|
-
fixStyle: "inline-type-imports"
|
|
346
|
-
}
|
|
347
|
-
],
|
|
348
|
-
// Allow _ for unused variables
|
|
349
|
-
"@typescript-eslint/no-unused-vars": [
|
|
350
|
-
"error",
|
|
351
|
-
{
|
|
352
|
-
args: "none",
|
|
353
|
-
caughtErrors: "none",
|
|
354
|
-
ignoreRestSiblings: true,
|
|
355
|
-
vars: "all",
|
|
356
|
-
argsIgnorePattern: "^_"
|
|
357
|
-
}
|
|
358
|
-
]
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
];
|
|
362
|
-
|
|
363
|
-
const vue = (options) => {
|
|
364
|
-
const opts = {
|
|
365
|
-
version: 3,
|
|
366
|
-
ts: true,
|
|
367
|
-
...options
|
|
368
|
-
};
|
|
369
|
-
const vueConfig = opts.version === 3 ? pluginVue.configs["flat/recommended"] : pluginVue.configs["flat/vue2-recommended"];
|
|
370
|
-
const languageOptions = opts.ts ? {
|
|
371
|
-
languageOptions: {
|
|
372
|
-
parserOptions: {
|
|
373
|
-
parser: neostandard.plugins["typescript-eslint"].parser
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
} : {};
|
|
377
|
-
const config = [
|
|
378
|
-
...vueConfig,
|
|
379
|
-
{
|
|
380
|
-
name: "kouts/vue",
|
|
381
|
-
files: ["*.vue", "**/*.vue"],
|
|
382
|
-
...languageOptions,
|
|
383
|
-
rules: {
|
|
384
|
-
// Overrides for vue/(vue3-)recommended preset
|
|
385
|
-
"vue/max-attributes-per-line": "off",
|
|
386
|
-
"vue/singleline-html-element-content-newline": "off",
|
|
387
|
-
// Strengthen vue/(vue3-)recommended preset for autofix
|
|
388
|
-
// https://github.com/vuejs/eslint-plugin-vue/blob/master/lib/configs/recommended.js
|
|
389
|
-
"vue/attributes-order": "error",
|
|
390
|
-
"vue/component-tags-order": "error",
|
|
391
|
-
"vue/no-lone-template": "error",
|
|
392
|
-
"vue/no-multiple-slot-args": "error",
|
|
393
|
-
"vue/no-v-html": "error",
|
|
394
|
-
"vue/order-in-components": "error",
|
|
395
|
-
"vue/this-in-template": "error",
|
|
396
|
-
"vue/require-prop-types": "error",
|
|
397
|
-
// Enforce PascalCase for Vue components
|
|
398
|
-
"vue/component-name-in-template-casing": ["error", "PascalCase", { registeredComponentsOnly: false, ignores: [] }],
|
|
399
|
-
// Do not allow inline styles
|
|
400
|
-
"vue/no-static-inline-styles": ["error", { allowBinding: false }],
|
|
401
|
-
// Require explicit emits
|
|
402
|
-
"vue/require-explicit-emits": "error",
|
|
403
|
-
// Require component to have a name property
|
|
404
|
-
"vue/require-name-property": "error",
|
|
405
|
-
// Require components that don't have any content to self-close
|
|
406
|
-
"vue/html-self-closing": [
|
|
407
|
-
"error",
|
|
408
|
-
{
|
|
409
|
-
html: {
|
|
410
|
-
void: "always",
|
|
411
|
-
normal: "never",
|
|
412
|
-
component: "always"
|
|
413
|
-
},
|
|
414
|
-
svg: "always",
|
|
415
|
-
math: "always"
|
|
416
|
-
}
|
|
417
|
-
]
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
];
|
|
421
|
-
return config;
|
|
422
|
-
};
|
|
423
|
-
|
|
424
|
-
const config = (options) => {
|
|
425
|
-
const opts = {
|
|
426
|
-
noJsx: true,
|
|
427
|
-
noStyle: true,
|
|
428
|
-
semi: false,
|
|
429
|
-
ts: true,
|
|
430
|
-
vue: true,
|
|
431
|
-
vueVersion: 3,
|
|
432
|
-
...options
|
|
433
|
-
};
|
|
434
|
-
const linterConfig = [
|
|
435
|
-
{
|
|
436
|
-
name: "kouts/ignores",
|
|
437
|
-
ignores: [
|
|
438
|
-
"**/node_modules/**",
|
|
439
|
-
"{tmp,temp}/**",
|
|
440
|
-
"**/*.min.js",
|
|
441
|
-
"vendor/**",
|
|
442
|
-
"dist/**",
|
|
443
|
-
"public/**",
|
|
444
|
-
...neostandard.resolveIgnoresFromGitignore()
|
|
445
|
-
]
|
|
446
|
-
},
|
|
447
|
-
// JavaScript
|
|
448
|
-
{
|
|
449
|
-
name: "kouts/javascript",
|
|
450
|
-
...js.configs.recommended
|
|
451
|
-
},
|
|
452
|
-
// TypeScript
|
|
453
|
-
...opts.ts ? typescript : [],
|
|
454
|
-
// Neostandard
|
|
455
|
-
...neostandard(opts),
|
|
456
|
-
{
|
|
457
|
-
name: "kouts/neostandard-overrides",
|
|
458
|
-
rules: {
|
|
459
|
-
// Enforce blank lines between the given 2 kinds of statements
|
|
460
|
-
"padding-line-between-statements": [
|
|
461
|
-
"error",
|
|
462
|
-
{ blankLine: "always", prev: "*", next: "return" },
|
|
463
|
-
{ blankLine: "always", prev: ["const", "let", "var"], next: "*" },
|
|
464
|
-
{ blankLine: "any", prev: ["const", "let", "var"], next: ["const", "let", "var"] },
|
|
465
|
-
{ blankLine: "always", prev: "directive", next: "*" },
|
|
466
|
-
{ blankLine: "any", prev: "directive", next: "directive" }
|
|
467
|
-
],
|
|
468
|
-
// Console and debugger settings depending whether we're on production or not
|
|
469
|
-
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
|
|
470
|
-
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off"
|
|
471
|
-
}
|
|
472
|
-
},
|
|
473
|
-
// Import
|
|
474
|
-
{
|
|
475
|
-
name: "kouts/import",
|
|
476
|
-
plugins: {
|
|
477
|
-
import: pluginImport
|
|
478
|
-
},
|
|
479
|
-
rules: {
|
|
480
|
-
"import/export": "error",
|
|
481
|
-
"import/first": "error",
|
|
482
|
-
"import/no-duplicates": "error",
|
|
483
|
-
"import/no-mutable-exports": "error",
|
|
484
|
-
"import/no-named-default": "error",
|
|
485
|
-
"import/no-self-import": "error",
|
|
486
|
-
"import/no-webpack-loader-syntax": "error",
|
|
487
|
-
"import/no-absolute-path": ["error", { esmodule: true, commonjs: true, amd: false }],
|
|
488
|
-
"import/newline-after-import": ["error", { count: 1 }]
|
|
489
|
-
}
|
|
490
|
-
},
|
|
491
|
-
// Sort imports
|
|
492
|
-
{
|
|
493
|
-
name: "kouts/sort-imports",
|
|
494
|
-
plugins: {
|
|
495
|
-
"simple-import-sort": pluginSimpleImportSort
|
|
496
|
-
},
|
|
497
|
-
rules: {
|
|
498
|
-
"simple-import-sort/imports": [
|
|
499
|
-
"error",
|
|
500
|
-
// Remove all blank lines between imports
|
|
501
|
-
{
|
|
502
|
-
groups: [["^\\u0000", "^node:", "^@?\\w", "^", "^\\."]]
|
|
503
|
-
}
|
|
504
|
-
],
|
|
505
|
-
"simple-import-sort/exports": "error"
|
|
506
|
-
}
|
|
507
|
-
},
|
|
508
|
-
// HTML
|
|
509
|
-
{
|
|
510
|
-
name: "kouts/html",
|
|
511
|
-
files: ["**/*.html"],
|
|
512
|
-
plugins: {
|
|
513
|
-
html: pluginHtml
|
|
514
|
-
}
|
|
515
|
-
},
|
|
516
|
-
// Vue
|
|
517
|
-
...opts.vue ? vue({ version: opts.vueVersion, ts: opts.ts }) : [],
|
|
518
|
-
// Prettier
|
|
519
|
-
{
|
|
520
|
-
name: "kouts/prettier",
|
|
521
|
-
...pluginPrettier
|
|
522
|
-
}
|
|
523
|
-
];
|
|
524
|
-
return linterConfig;
|
|
525
|
-
};
|
|
526
|
-
|
|
527
|
-
Object.defineProperty(exports, "plugins", {
|
|
528
|
-
enumerable: true,
|
|
529
|
-
get: function () { return neostandard.plugins; }
|
|
530
|
-
});
|
|
531
|
-
exports.config = config;
|
package/dist/index.d.cts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Linter } from 'eslint';
|
|
2
|
-
import { NeostandardOptions } from 'neostandard';
|
|
3
|
-
export { plugins } from 'neostandard';
|
|
4
|
-
|
|
5
|
-
type Options = {
|
|
6
|
-
vue?: boolean;
|
|
7
|
-
vueVersion?: 2 | 3;
|
|
8
|
-
} & NeostandardOptions;
|
|
9
|
-
declare const config: (options?: Options) => Linter.Config<Linter.RulesRecord>[];
|
|
10
|
-
|
|
11
|
-
export { config };
|
package/dist/index.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Linter } from 'eslint';
|
|
2
|
-
import { NeostandardOptions } from 'neostandard';
|
|
3
|
-
export { plugins } from 'neostandard';
|
|
4
|
-
|
|
5
|
-
type Options = {
|
|
6
|
-
vue?: boolean;
|
|
7
|
-
vueVersion?: 2 | 3;
|
|
8
|
-
} & NeostandardOptions;
|
|
9
|
-
declare const config: (options?: Options) => Linter.Config<Linter.RulesRecord>[];
|
|
10
|
-
|
|
11
|
-
export { config };
|
package/dist/index.js
DELETED
|
@@ -1,526 +0,0 @@
|
|
|
1
|
-
import pluginHtml from 'eslint-plugin-html';
|
|
2
|
-
import pluginImport from 'eslint-plugin-import-x';
|
|
3
|
-
import pluginPrettier from 'eslint-plugin-prettier/recommended';
|
|
4
|
-
import pluginSimpleImportSort from 'eslint-plugin-simple-import-sort';
|
|
5
|
-
import neostandard, { plugins, resolveIgnoresFromGitignore } from 'neostandard';
|
|
6
|
-
export { plugins } from 'neostandard';
|
|
7
|
-
import pluginVue from 'eslint-plugin-vue';
|
|
8
|
-
|
|
9
|
-
function getDefaultExportFromCjs (x) {
|
|
10
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/*
|
|
14
|
-
* WARNING: This file is autogenerated using the tools/update-eslint-all.js
|
|
15
|
-
* script. Do not edit manually.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
/* eslint quote-props: off -- autogenerated so don't lint */
|
|
19
|
-
|
|
20
|
-
/*
|
|
21
|
-
* IMPORTANT!
|
|
22
|
-
*
|
|
23
|
-
* We cannot add a "name" property to this object because it's still used in eslintrc
|
|
24
|
-
* which doesn't support the "name" property. If we add a "name" property, it will
|
|
25
|
-
* cause an error.
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
|
-
var eslintAll = Object.freeze({
|
|
29
|
-
"rules": {
|
|
30
|
-
"accessor-pairs": "error",
|
|
31
|
-
"array-callback-return": "error",
|
|
32
|
-
"arrow-body-style": "error",
|
|
33
|
-
"block-scoped-var": "error",
|
|
34
|
-
"camelcase": "error",
|
|
35
|
-
"capitalized-comments": "error",
|
|
36
|
-
"class-methods-use-this": "error",
|
|
37
|
-
"complexity": "error",
|
|
38
|
-
"consistent-return": "error",
|
|
39
|
-
"consistent-this": "error",
|
|
40
|
-
"constructor-super": "error",
|
|
41
|
-
"curly": "error",
|
|
42
|
-
"default-case": "error",
|
|
43
|
-
"default-case-last": "error",
|
|
44
|
-
"default-param-last": "error",
|
|
45
|
-
"dot-notation": "error",
|
|
46
|
-
"eqeqeq": "error",
|
|
47
|
-
"for-direction": "error",
|
|
48
|
-
"func-name-matching": "error",
|
|
49
|
-
"func-names": "error",
|
|
50
|
-
"func-style": "error",
|
|
51
|
-
"getter-return": "error",
|
|
52
|
-
"grouped-accessor-pairs": "error",
|
|
53
|
-
"guard-for-in": "error",
|
|
54
|
-
"id-denylist": "error",
|
|
55
|
-
"id-length": "error",
|
|
56
|
-
"id-match": "error",
|
|
57
|
-
"init-declarations": "error",
|
|
58
|
-
"logical-assignment-operators": "error",
|
|
59
|
-
"max-classes-per-file": "error",
|
|
60
|
-
"max-depth": "error",
|
|
61
|
-
"max-lines": "error",
|
|
62
|
-
"max-lines-per-function": "error",
|
|
63
|
-
"max-nested-callbacks": "error",
|
|
64
|
-
"max-params": "error",
|
|
65
|
-
"max-statements": "error",
|
|
66
|
-
"new-cap": "error",
|
|
67
|
-
"no-alert": "error",
|
|
68
|
-
"no-array-constructor": "error",
|
|
69
|
-
"no-async-promise-executor": "error",
|
|
70
|
-
"no-await-in-loop": "error",
|
|
71
|
-
"no-bitwise": "error",
|
|
72
|
-
"no-caller": "error",
|
|
73
|
-
"no-case-declarations": "error",
|
|
74
|
-
"no-class-assign": "error",
|
|
75
|
-
"no-compare-neg-zero": "error",
|
|
76
|
-
"no-cond-assign": "error",
|
|
77
|
-
"no-console": "error",
|
|
78
|
-
"no-const-assign": "error",
|
|
79
|
-
"no-constant-binary-expression": "error",
|
|
80
|
-
"no-constant-condition": "error",
|
|
81
|
-
"no-constructor-return": "error",
|
|
82
|
-
"no-continue": "error",
|
|
83
|
-
"no-control-regex": "error",
|
|
84
|
-
"no-debugger": "error",
|
|
85
|
-
"no-delete-var": "error",
|
|
86
|
-
"no-div-regex": "error",
|
|
87
|
-
"no-dupe-args": "error",
|
|
88
|
-
"no-dupe-class-members": "error",
|
|
89
|
-
"no-dupe-else-if": "error",
|
|
90
|
-
"no-dupe-keys": "error",
|
|
91
|
-
"no-duplicate-case": "error",
|
|
92
|
-
"no-duplicate-imports": "error",
|
|
93
|
-
"no-else-return": "error",
|
|
94
|
-
"no-empty": "error",
|
|
95
|
-
"no-empty-character-class": "error",
|
|
96
|
-
"no-empty-function": "error",
|
|
97
|
-
"no-empty-pattern": "error",
|
|
98
|
-
"no-empty-static-block": "error",
|
|
99
|
-
"no-eq-null": "error",
|
|
100
|
-
"no-eval": "error",
|
|
101
|
-
"no-ex-assign": "error",
|
|
102
|
-
"no-extend-native": "error",
|
|
103
|
-
"no-extra-bind": "error",
|
|
104
|
-
"no-extra-boolean-cast": "error",
|
|
105
|
-
"no-extra-label": "error",
|
|
106
|
-
"no-fallthrough": "error",
|
|
107
|
-
"no-func-assign": "error",
|
|
108
|
-
"no-global-assign": "error",
|
|
109
|
-
"no-implicit-coercion": "error",
|
|
110
|
-
"no-implicit-globals": "error",
|
|
111
|
-
"no-implied-eval": "error",
|
|
112
|
-
"no-import-assign": "error",
|
|
113
|
-
"no-inline-comments": "error",
|
|
114
|
-
"no-inner-declarations": "error",
|
|
115
|
-
"no-invalid-regexp": "error",
|
|
116
|
-
"no-invalid-this": "error",
|
|
117
|
-
"no-irregular-whitespace": "error",
|
|
118
|
-
"no-iterator": "error",
|
|
119
|
-
"no-label-var": "error",
|
|
120
|
-
"no-labels": "error",
|
|
121
|
-
"no-lone-blocks": "error",
|
|
122
|
-
"no-lonely-if": "error",
|
|
123
|
-
"no-loop-func": "error",
|
|
124
|
-
"no-loss-of-precision": "error",
|
|
125
|
-
"no-magic-numbers": "error",
|
|
126
|
-
"no-misleading-character-class": "error",
|
|
127
|
-
"no-multi-assign": "error",
|
|
128
|
-
"no-multi-str": "error",
|
|
129
|
-
"no-negated-condition": "error",
|
|
130
|
-
"no-nested-ternary": "error",
|
|
131
|
-
"no-new": "error",
|
|
132
|
-
"no-new-func": "error",
|
|
133
|
-
"no-new-native-nonconstructor": "error",
|
|
134
|
-
"no-new-wrappers": "error",
|
|
135
|
-
"no-nonoctal-decimal-escape": "error",
|
|
136
|
-
"no-obj-calls": "error",
|
|
137
|
-
"no-object-constructor": "error",
|
|
138
|
-
"no-octal": "error",
|
|
139
|
-
"no-octal-escape": "error",
|
|
140
|
-
"no-param-reassign": "error",
|
|
141
|
-
"no-plusplus": "error",
|
|
142
|
-
"no-promise-executor-return": "error",
|
|
143
|
-
"no-proto": "error",
|
|
144
|
-
"no-prototype-builtins": "error",
|
|
145
|
-
"no-redeclare": "error",
|
|
146
|
-
"no-regex-spaces": "error",
|
|
147
|
-
"no-restricted-exports": "error",
|
|
148
|
-
"no-restricted-globals": "error",
|
|
149
|
-
"no-restricted-imports": "error",
|
|
150
|
-
"no-restricted-properties": "error",
|
|
151
|
-
"no-restricted-syntax": "error",
|
|
152
|
-
"no-return-assign": "error",
|
|
153
|
-
"no-script-url": "error",
|
|
154
|
-
"no-self-assign": "error",
|
|
155
|
-
"no-self-compare": "error",
|
|
156
|
-
"no-sequences": "error",
|
|
157
|
-
"no-setter-return": "error",
|
|
158
|
-
"no-shadow": "error",
|
|
159
|
-
"no-shadow-restricted-names": "error",
|
|
160
|
-
"no-sparse-arrays": "error",
|
|
161
|
-
"no-template-curly-in-string": "error",
|
|
162
|
-
"no-ternary": "error",
|
|
163
|
-
"no-this-before-super": "error",
|
|
164
|
-
"no-throw-literal": "error",
|
|
165
|
-
"no-undef": "error",
|
|
166
|
-
"no-undef-init": "error",
|
|
167
|
-
"no-undefined": "error",
|
|
168
|
-
"no-underscore-dangle": "error",
|
|
169
|
-
"no-unexpected-multiline": "error",
|
|
170
|
-
"no-unmodified-loop-condition": "error",
|
|
171
|
-
"no-unneeded-ternary": "error",
|
|
172
|
-
"no-unreachable": "error",
|
|
173
|
-
"no-unreachable-loop": "error",
|
|
174
|
-
"no-unsafe-finally": "error",
|
|
175
|
-
"no-unsafe-negation": "error",
|
|
176
|
-
"no-unsafe-optional-chaining": "error",
|
|
177
|
-
"no-unused-expressions": "error",
|
|
178
|
-
"no-unused-labels": "error",
|
|
179
|
-
"no-unused-private-class-members": "error",
|
|
180
|
-
"no-unused-vars": "error",
|
|
181
|
-
"no-use-before-define": "error",
|
|
182
|
-
"no-useless-assignment": "error",
|
|
183
|
-
"no-useless-backreference": "error",
|
|
184
|
-
"no-useless-call": "error",
|
|
185
|
-
"no-useless-catch": "error",
|
|
186
|
-
"no-useless-computed-key": "error",
|
|
187
|
-
"no-useless-concat": "error",
|
|
188
|
-
"no-useless-constructor": "error",
|
|
189
|
-
"no-useless-escape": "error",
|
|
190
|
-
"no-useless-rename": "error",
|
|
191
|
-
"no-useless-return": "error",
|
|
192
|
-
"no-var": "error",
|
|
193
|
-
"no-void": "error",
|
|
194
|
-
"no-warning-comments": "error",
|
|
195
|
-
"no-with": "error",
|
|
196
|
-
"object-shorthand": "error",
|
|
197
|
-
"one-var": "error",
|
|
198
|
-
"operator-assignment": "error",
|
|
199
|
-
"prefer-arrow-callback": "error",
|
|
200
|
-
"prefer-const": "error",
|
|
201
|
-
"prefer-destructuring": "error",
|
|
202
|
-
"prefer-exponentiation-operator": "error",
|
|
203
|
-
"prefer-named-capture-group": "error",
|
|
204
|
-
"prefer-numeric-literals": "error",
|
|
205
|
-
"prefer-object-has-own": "error",
|
|
206
|
-
"prefer-object-spread": "error",
|
|
207
|
-
"prefer-promise-reject-errors": "error",
|
|
208
|
-
"prefer-regex-literals": "error",
|
|
209
|
-
"prefer-rest-params": "error",
|
|
210
|
-
"prefer-spread": "error",
|
|
211
|
-
"prefer-template": "error",
|
|
212
|
-
"radix": "error",
|
|
213
|
-
"require-atomic-updates": "error",
|
|
214
|
-
"require-await": "error",
|
|
215
|
-
"require-unicode-regexp": "error",
|
|
216
|
-
"require-yield": "error",
|
|
217
|
-
"sort-imports": "error",
|
|
218
|
-
"sort-keys": "error",
|
|
219
|
-
"sort-vars": "error",
|
|
220
|
-
"strict": "error",
|
|
221
|
-
"symbol-description": "error",
|
|
222
|
-
"unicode-bom": "error",
|
|
223
|
-
"use-isnan": "error",
|
|
224
|
-
"valid-typeof": "error",
|
|
225
|
-
"vars-on-top": "error",
|
|
226
|
-
"yoda": "error"
|
|
227
|
-
}
|
|
228
|
-
});
|
|
229
|
-
|
|
230
|
-
/**
|
|
231
|
-
* @fileoverview Configuration applied when a user configuration extends from
|
|
232
|
-
* eslint:recommended.
|
|
233
|
-
* @author Nicholas C. Zakas
|
|
234
|
-
*/
|
|
235
|
-
|
|
236
|
-
/* eslint sort-keys: ["error", "asc"] -- Long, so make more readable */
|
|
237
|
-
|
|
238
|
-
/*
|
|
239
|
-
* IMPORTANT!
|
|
240
|
-
*
|
|
241
|
-
* We cannot add a "name" property to this object because it's still used in eslintrc
|
|
242
|
-
* which doesn't support the "name" property. If we add a "name" property, it will
|
|
243
|
-
* cause an error.
|
|
244
|
-
*/
|
|
245
|
-
|
|
246
|
-
var eslintRecommended = Object.freeze({
|
|
247
|
-
rules: Object.freeze({
|
|
248
|
-
"constructor-super": "error",
|
|
249
|
-
"for-direction": "error",
|
|
250
|
-
"getter-return": "error",
|
|
251
|
-
"no-async-promise-executor": "error",
|
|
252
|
-
"no-case-declarations": "error",
|
|
253
|
-
"no-class-assign": "error",
|
|
254
|
-
"no-compare-neg-zero": "error",
|
|
255
|
-
"no-cond-assign": "error",
|
|
256
|
-
"no-const-assign": "error",
|
|
257
|
-
"no-constant-binary-expression": "error",
|
|
258
|
-
"no-constant-condition": "error",
|
|
259
|
-
"no-control-regex": "error",
|
|
260
|
-
"no-debugger": "error",
|
|
261
|
-
"no-delete-var": "error",
|
|
262
|
-
"no-dupe-args": "error",
|
|
263
|
-
"no-dupe-class-members": "error",
|
|
264
|
-
"no-dupe-else-if": "error",
|
|
265
|
-
"no-dupe-keys": "error",
|
|
266
|
-
"no-duplicate-case": "error",
|
|
267
|
-
"no-empty": "error",
|
|
268
|
-
"no-empty-character-class": "error",
|
|
269
|
-
"no-empty-pattern": "error",
|
|
270
|
-
"no-empty-static-block": "error",
|
|
271
|
-
"no-ex-assign": "error",
|
|
272
|
-
"no-extra-boolean-cast": "error",
|
|
273
|
-
"no-fallthrough": "error",
|
|
274
|
-
"no-func-assign": "error",
|
|
275
|
-
"no-global-assign": "error",
|
|
276
|
-
"no-import-assign": "error",
|
|
277
|
-
"no-invalid-regexp": "error",
|
|
278
|
-
"no-irregular-whitespace": "error",
|
|
279
|
-
"no-loss-of-precision": "error",
|
|
280
|
-
"no-misleading-character-class": "error",
|
|
281
|
-
"no-new-native-nonconstructor": "error",
|
|
282
|
-
"no-nonoctal-decimal-escape": "error",
|
|
283
|
-
"no-obj-calls": "error",
|
|
284
|
-
"no-octal": "error",
|
|
285
|
-
"no-prototype-builtins": "error",
|
|
286
|
-
"no-redeclare": "error",
|
|
287
|
-
"no-regex-spaces": "error",
|
|
288
|
-
"no-self-assign": "error",
|
|
289
|
-
"no-setter-return": "error",
|
|
290
|
-
"no-shadow-restricted-names": "error",
|
|
291
|
-
"no-sparse-arrays": "error",
|
|
292
|
-
"no-this-before-super": "error",
|
|
293
|
-
"no-undef": "error",
|
|
294
|
-
"no-unexpected-multiline": "error",
|
|
295
|
-
"no-unreachable": "error",
|
|
296
|
-
"no-unsafe-finally": "error",
|
|
297
|
-
"no-unsafe-negation": "error",
|
|
298
|
-
"no-unsafe-optional-chaining": "error",
|
|
299
|
-
"no-unused-labels": "error",
|
|
300
|
-
"no-unused-private-class-members": "error",
|
|
301
|
-
"no-unused-vars": "error",
|
|
302
|
-
"no-useless-backreference": "error",
|
|
303
|
-
"no-useless-catch": "error",
|
|
304
|
-
"no-useless-escape": "error",
|
|
305
|
-
"no-with": "error",
|
|
306
|
-
"require-yield": "error",
|
|
307
|
-
"use-isnan": "error",
|
|
308
|
-
"valid-typeof": "error"
|
|
309
|
-
})
|
|
310
|
-
});
|
|
311
|
-
|
|
312
|
-
/**
|
|
313
|
-
* @fileoverview Main package entrypoint.
|
|
314
|
-
* @author Nicholas C. Zakas
|
|
315
|
-
*/
|
|
316
|
-
|
|
317
|
-
//------------------------------------------------------------------------------
|
|
318
|
-
// Public Interface
|
|
319
|
-
//------------------------------------------------------------------------------
|
|
320
|
-
|
|
321
|
-
var src = {
|
|
322
|
-
configs: {
|
|
323
|
-
all: eslintAll,
|
|
324
|
-
recommended: eslintRecommended
|
|
325
|
-
}
|
|
326
|
-
};
|
|
327
|
-
|
|
328
|
-
var js = /*@__PURE__*/getDefaultExportFromCjs(src);
|
|
329
|
-
|
|
330
|
-
const typescript = [
|
|
331
|
-
...plugins["typescript-eslint"].configs.recommended,
|
|
332
|
-
{
|
|
333
|
-
name: "kouts/typescript",
|
|
334
|
-
rules: {
|
|
335
|
-
// Prefer T[] instead of Array<T>
|
|
336
|
-
"@typescript-eslint/array-type": ["error", { default: "array" }],
|
|
337
|
-
// Prefer type over interface for objects
|
|
338
|
-
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
|
|
339
|
-
// Fix type imports
|
|
340
|
-
"@typescript-eslint/consistent-type-imports": [
|
|
341
|
-
"error",
|
|
342
|
-
{
|
|
343
|
-
prefer: "type-imports",
|
|
344
|
-
fixStyle: "inline-type-imports"
|
|
345
|
-
}
|
|
346
|
-
],
|
|
347
|
-
// Allow _ for unused variables
|
|
348
|
-
"@typescript-eslint/no-unused-vars": [
|
|
349
|
-
"error",
|
|
350
|
-
{
|
|
351
|
-
args: "none",
|
|
352
|
-
caughtErrors: "none",
|
|
353
|
-
ignoreRestSiblings: true,
|
|
354
|
-
vars: "all",
|
|
355
|
-
argsIgnorePattern: "^_"
|
|
356
|
-
}
|
|
357
|
-
]
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
];
|
|
361
|
-
|
|
362
|
-
const vue = (options) => {
|
|
363
|
-
const opts = {
|
|
364
|
-
version: 3,
|
|
365
|
-
ts: true,
|
|
366
|
-
...options
|
|
367
|
-
};
|
|
368
|
-
const vueConfig = opts.version === 3 ? pluginVue.configs["flat/recommended"] : pluginVue.configs["flat/vue2-recommended"];
|
|
369
|
-
const languageOptions = opts.ts ? {
|
|
370
|
-
languageOptions: {
|
|
371
|
-
parserOptions: {
|
|
372
|
-
parser: plugins["typescript-eslint"].parser
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
} : {};
|
|
376
|
-
const config = [
|
|
377
|
-
...vueConfig,
|
|
378
|
-
{
|
|
379
|
-
name: "kouts/vue",
|
|
380
|
-
files: ["*.vue", "**/*.vue"],
|
|
381
|
-
...languageOptions,
|
|
382
|
-
rules: {
|
|
383
|
-
// Overrides for vue/(vue3-)recommended preset
|
|
384
|
-
"vue/max-attributes-per-line": "off",
|
|
385
|
-
"vue/singleline-html-element-content-newline": "off",
|
|
386
|
-
// Strengthen vue/(vue3-)recommended preset for autofix
|
|
387
|
-
// https://github.com/vuejs/eslint-plugin-vue/blob/master/lib/configs/recommended.js
|
|
388
|
-
"vue/attributes-order": "error",
|
|
389
|
-
"vue/component-tags-order": "error",
|
|
390
|
-
"vue/no-lone-template": "error",
|
|
391
|
-
"vue/no-multiple-slot-args": "error",
|
|
392
|
-
"vue/no-v-html": "error",
|
|
393
|
-
"vue/order-in-components": "error",
|
|
394
|
-
"vue/this-in-template": "error",
|
|
395
|
-
"vue/require-prop-types": "error",
|
|
396
|
-
// Enforce PascalCase for Vue components
|
|
397
|
-
"vue/component-name-in-template-casing": ["error", "PascalCase", { registeredComponentsOnly: false, ignores: [] }],
|
|
398
|
-
// Do not allow inline styles
|
|
399
|
-
"vue/no-static-inline-styles": ["error", { allowBinding: false }],
|
|
400
|
-
// Require explicit emits
|
|
401
|
-
"vue/require-explicit-emits": "error",
|
|
402
|
-
// Require component to have a name property
|
|
403
|
-
"vue/require-name-property": "error",
|
|
404
|
-
// Require components that don't have any content to self-close
|
|
405
|
-
"vue/html-self-closing": [
|
|
406
|
-
"error",
|
|
407
|
-
{
|
|
408
|
-
html: {
|
|
409
|
-
void: "always",
|
|
410
|
-
normal: "never",
|
|
411
|
-
component: "always"
|
|
412
|
-
},
|
|
413
|
-
svg: "always",
|
|
414
|
-
math: "always"
|
|
415
|
-
}
|
|
416
|
-
]
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
];
|
|
420
|
-
return config;
|
|
421
|
-
};
|
|
422
|
-
|
|
423
|
-
const config = (options) => {
|
|
424
|
-
const opts = {
|
|
425
|
-
noJsx: true,
|
|
426
|
-
noStyle: true,
|
|
427
|
-
semi: false,
|
|
428
|
-
ts: true,
|
|
429
|
-
vue: true,
|
|
430
|
-
vueVersion: 3,
|
|
431
|
-
...options
|
|
432
|
-
};
|
|
433
|
-
const linterConfig = [
|
|
434
|
-
{
|
|
435
|
-
name: "kouts/ignores",
|
|
436
|
-
ignores: [
|
|
437
|
-
"**/node_modules/**",
|
|
438
|
-
"{tmp,temp}/**",
|
|
439
|
-
"**/*.min.js",
|
|
440
|
-
"vendor/**",
|
|
441
|
-
"dist/**",
|
|
442
|
-
"public/**",
|
|
443
|
-
...resolveIgnoresFromGitignore()
|
|
444
|
-
]
|
|
445
|
-
},
|
|
446
|
-
// JavaScript
|
|
447
|
-
{
|
|
448
|
-
name: "kouts/javascript",
|
|
449
|
-
...js.configs.recommended
|
|
450
|
-
},
|
|
451
|
-
// TypeScript
|
|
452
|
-
...opts.ts ? typescript : [],
|
|
453
|
-
// Neostandard
|
|
454
|
-
...neostandard(opts),
|
|
455
|
-
{
|
|
456
|
-
name: "kouts/neostandard-overrides",
|
|
457
|
-
rules: {
|
|
458
|
-
// Enforce blank lines between the given 2 kinds of statements
|
|
459
|
-
"padding-line-between-statements": [
|
|
460
|
-
"error",
|
|
461
|
-
{ blankLine: "always", prev: "*", next: "return" },
|
|
462
|
-
{ blankLine: "always", prev: ["const", "let", "var"], next: "*" },
|
|
463
|
-
{ blankLine: "any", prev: ["const", "let", "var"], next: ["const", "let", "var"] },
|
|
464
|
-
{ blankLine: "always", prev: "directive", next: "*" },
|
|
465
|
-
{ blankLine: "any", prev: "directive", next: "directive" }
|
|
466
|
-
],
|
|
467
|
-
// Console and debugger settings depending whether we're on production or not
|
|
468
|
-
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
|
|
469
|
-
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off"
|
|
470
|
-
}
|
|
471
|
-
},
|
|
472
|
-
// Import
|
|
473
|
-
{
|
|
474
|
-
name: "kouts/import",
|
|
475
|
-
plugins: {
|
|
476
|
-
import: pluginImport
|
|
477
|
-
},
|
|
478
|
-
rules: {
|
|
479
|
-
"import/export": "error",
|
|
480
|
-
"import/first": "error",
|
|
481
|
-
"import/no-duplicates": "error",
|
|
482
|
-
"import/no-mutable-exports": "error",
|
|
483
|
-
"import/no-named-default": "error",
|
|
484
|
-
"import/no-self-import": "error",
|
|
485
|
-
"import/no-webpack-loader-syntax": "error",
|
|
486
|
-
"import/no-absolute-path": ["error", { esmodule: true, commonjs: true, amd: false }],
|
|
487
|
-
"import/newline-after-import": ["error", { count: 1 }]
|
|
488
|
-
}
|
|
489
|
-
},
|
|
490
|
-
// Sort imports
|
|
491
|
-
{
|
|
492
|
-
name: "kouts/sort-imports",
|
|
493
|
-
plugins: {
|
|
494
|
-
"simple-import-sort": pluginSimpleImportSort
|
|
495
|
-
},
|
|
496
|
-
rules: {
|
|
497
|
-
"simple-import-sort/imports": [
|
|
498
|
-
"error",
|
|
499
|
-
// Remove all blank lines between imports
|
|
500
|
-
{
|
|
501
|
-
groups: [["^\\u0000", "^node:", "^@?\\w", "^", "^\\."]]
|
|
502
|
-
}
|
|
503
|
-
],
|
|
504
|
-
"simple-import-sort/exports": "error"
|
|
505
|
-
}
|
|
506
|
-
},
|
|
507
|
-
// HTML
|
|
508
|
-
{
|
|
509
|
-
name: "kouts/html",
|
|
510
|
-
files: ["**/*.html"],
|
|
511
|
-
plugins: {
|
|
512
|
-
html: pluginHtml
|
|
513
|
-
}
|
|
514
|
-
},
|
|
515
|
-
// Vue
|
|
516
|
-
...opts.vue ? vue({ version: opts.vueVersion, ts: opts.ts }) : [],
|
|
517
|
-
// Prettier
|
|
518
|
-
{
|
|
519
|
-
name: "kouts/prettier",
|
|
520
|
-
...pluginPrettier
|
|
521
|
-
}
|
|
522
|
-
];
|
|
523
|
-
return linterConfig;
|
|
524
|
-
};
|
|
525
|
-
|
|
526
|
-
export { config };
|
package/dist/prettier.cjs
DELETED
package/dist/prettier.d.cts
DELETED
package/dist/prettier.d.ts
DELETED