@component-hook/eslint-plugin 1.3.2 → 1.4.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 +17 -15
- package/dist/index.cjs +372 -81
- package/dist/index.d.cts +7528 -13
- package/dist/index.d.mts +7528 -13
- package/dist/index.mjs +349 -66
- package/package.json +41 -34
package/README.md
CHANGED
|
@@ -86,21 +86,21 @@ export default vuePreset;
|
|
|
86
86
|
|
|
87
87
|
## Configs
|
|
88
88
|
|
|
89
|
-
| Name | Type | Reference
|
|
90
|
-
| ----------------------- | ----------------- |
|
|
91
|
-
| basic | `Linter.Config[]` | `eslint-recommended`, `typescript-eslint`, `eslint-plugin-eslint-comments`, `eslint-plugin-import`, `eslint-plugin-unicorn`, `eslint-plugin-jsdoc`, `eslint-plugin-regexp`, `eslint-plugin-de-morgan`, `eslint-plugin-perfectionist` |
|
|
92
|
-
| vue | `Linter.Config[]` | `eslint-plugin-vue`, `typescript-eslint`
|
|
93
|
-
| react | `Linter.Config[]` | `eslint-plugin-react/recommended`, `eslint-plugin-react-hooks/recommended`, `eslint-plugin-jsx-a11y/recommended`
|
|
94
|
-
| markdown | `Linter.Config[]` | `@eslint/markdown`
|
|
95
|
-
| prettier | `Linter.Config` | `eslint-plugin-prettier/recommended`
|
|
96
|
-
| sonarjs | `Linter.Config[]` | `eslint-plugin-sonarjs/recommended`
|
|
97
|
-
| security | `Linter.Config` | `eslint-plugin-security/recommended`
|
|
98
|
-
| playwright | `Linter.Config` | `eslint-plugin-playwright/flat/recommended`
|
|
99
|
-
| testing-library/dom | `Linter.Config` | `eslint-plugin-testing-library/dom`
|
|
100
|
-
| testing-library/vue | `Linter.Config` | `eslint-plugin-testing-library/vue`
|
|
101
|
-
| testing-library/react | `Linter.Config` | `eslint-plugin-testing-library/react`
|
|
102
|
-
| testing-library/angular | `Linter.Config` | `eslint-plugin-testing-library/angular`
|
|
103
|
-
| testing-library/marko | `Linter.Config` | `eslint-plugin-testing-library/marko`
|
|
89
|
+
| Name | Type | Reference |
|
|
90
|
+
| ----------------------- | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
91
|
+
| basic | `Linter.Config[]` | `eslint-recommended`, `typescript-eslint`, `eslint-plugin-eslint-comments`, `eslint-plugin-import`, `eslint-plugin-unicorn`, `eslint-plugin-jsdoc`, `eslint-plugin-regexp`, `eslint-plugin-de-morgan`, `eslint-plugin-perfectionist`, `eslint-plugin-jsonc`, `eslint-plugin-yml` |
|
|
92
|
+
| vue | `Linter.Config[]` | `eslint-plugin-vue`, `typescript-eslint` |
|
|
93
|
+
| react | `Linter.Config[]` | `eslint-plugin-react/recommended`, `eslint-plugin-react-hooks/recommended`, `eslint-plugin-jsx-a11y/recommended` |
|
|
94
|
+
| markdown | `Linter.Config[]` | `@eslint/markdown` |
|
|
95
|
+
| prettier | `Linter.Config` | `eslint-plugin-prettier/recommended` |
|
|
96
|
+
| sonarjs | `Linter.Config[]` | `eslint-plugin-sonarjs/recommended` |
|
|
97
|
+
| security | `Linter.Config` | `eslint-plugin-security/recommended` |
|
|
98
|
+
| playwright | `Linter.Config` | `eslint-plugin-playwright/flat/recommended` |
|
|
99
|
+
| testing-library/dom | `Linter.Config` | `eslint-plugin-testing-library/dom` |
|
|
100
|
+
| testing-library/vue | `Linter.Config` | `eslint-plugin-testing-library/vue` |
|
|
101
|
+
| testing-library/react | `Linter.Config` | `eslint-plugin-testing-library/react` |
|
|
102
|
+
| testing-library/angular | `Linter.Config` | `eslint-plugin-testing-library/angular` |
|
|
103
|
+
| testing-library/marko | `Linter.Config` | `eslint-plugin-testing-library/marko` |
|
|
104
104
|
|
|
105
105
|
## Reference eslint plugin
|
|
106
106
|
|
|
@@ -112,7 +112,9 @@ export default vuePreset;
|
|
|
112
112
|
- [eslint-plugin-regexp/flat/recommended](https://github.com/ota-meshi/eslint-plugin-regexp/blob/master/lib/configs/flat/recommended.ts)
|
|
113
113
|
- [eslint-plugin-de-morgan](https://github.com/azat-io/eslint-plugin-de-morgan/blob/main/index.ts)
|
|
114
114
|
- [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc)
|
|
115
|
+
- [eslint-plugin-jsonc](https://github.com/ota-meshi/eslint-plugin-jsonc/blob/master/lib/configs/recommended-with-jsonc.ts)
|
|
115
116
|
- [eslint-plugin-perfectionist](https://github.com/azat-io/eslint-plugin-perfectionist)
|
|
117
|
+
- [eslint-plugin-yml](https://github.com/ota-meshi/eslint-plugin-yml)
|
|
116
118
|
- [eslint-plugin-prettier/recommended](https://github.com/prettier/eslint-plugin-prettier/blob/master/recommended.js)
|
|
117
119
|
- [eslint-plugin-react/recommended](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/configs/recommended.js)
|
|
118
120
|
- [eslint-plugin-react-hooks/recommended](https://github.com/facebook/react/blob/main/packages/eslint-plugin-react-hooks/src/index.js)
|
package/dist/index.cjs
CHANGED
|
@@ -7,12 +7,16 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
7
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
9
|
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function")
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
12
|
+
key = keys[i];
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
14
|
+
__defProp(to, key, {
|
|
15
|
+
get: ((k) => from[k]).bind(null, key),
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
16
20
|
}
|
|
17
21
|
return to;
|
|
18
22
|
};
|
|
@@ -24,8 +28,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
28
|
//#endregion
|
|
25
29
|
let globals = require("globals");
|
|
26
30
|
globals = __toESM(globals);
|
|
27
|
-
let
|
|
28
|
-
|
|
31
|
+
let _eslint_js = require("@eslint/js");
|
|
32
|
+
_eslint_js = __toESM(_eslint_js);
|
|
29
33
|
let typescript_eslint = require("typescript-eslint");
|
|
30
34
|
typescript_eslint = __toESM(typescript_eslint);
|
|
31
35
|
let eslint_plugin_react = require("eslint-plugin-react");
|
|
@@ -54,10 +58,10 @@ let eslint_plugin_regexp = require("eslint-plugin-regexp");
|
|
|
54
58
|
eslint_plugin_regexp = __toESM(eslint_plugin_regexp);
|
|
55
59
|
let eslint_plugin_import = require("eslint-plugin-import");
|
|
56
60
|
eslint_plugin_import = __toESM(eslint_plugin_import);
|
|
57
|
-
let
|
|
58
|
-
|
|
59
|
-
let
|
|
60
|
-
|
|
61
|
+
let _eslint_markdown = require("@eslint/markdown");
|
|
62
|
+
_eslint_markdown = __toESM(_eslint_markdown);
|
|
63
|
+
let _eslint_community_eslint_plugin_eslint_comments_configs = require("@eslint-community/eslint-plugin-eslint-comments/configs");
|
|
64
|
+
_eslint_community_eslint_plugin_eslint_comments_configs = __toESM(_eslint_community_eslint_plugin_eslint_comments_configs);
|
|
61
65
|
let eslint_plugin_unicorn = require("eslint-plugin-unicorn");
|
|
62
66
|
eslint_plugin_unicorn = __toESM(eslint_plugin_unicorn);
|
|
63
67
|
let eslint_plugin_de_morgan = require("eslint-plugin-de-morgan");
|
|
@@ -66,10 +70,18 @@ let eslint_plugin_perfectionist = require("eslint-plugin-perfectionist");
|
|
|
66
70
|
eslint_plugin_perfectionist = __toESM(eslint_plugin_perfectionist);
|
|
67
71
|
let eslint_plugin_jsdoc = require("eslint-plugin-jsdoc");
|
|
68
72
|
eslint_plugin_jsdoc = __toESM(eslint_plugin_jsdoc);
|
|
73
|
+
let eslint_plugin_jsonc = require("eslint-plugin-jsonc");
|
|
74
|
+
eslint_plugin_jsonc = __toESM(eslint_plugin_jsonc);
|
|
75
|
+
let jsonc_eslint_parser = require("jsonc-eslint-parser");
|
|
76
|
+
jsonc_eslint_parser = __toESM(jsonc_eslint_parser);
|
|
77
|
+
let eslint_plugin_yml = require("eslint-plugin-yml");
|
|
78
|
+
eslint_plugin_yml = __toESM(eslint_plugin_yml);
|
|
79
|
+
let yaml_eslint_parser = require("yaml-eslint-parser");
|
|
80
|
+
yaml_eslint_parser = __toESM(yaml_eslint_parser);
|
|
69
81
|
|
|
70
82
|
//#region configs/comments.ts
|
|
71
83
|
const commentsConfigs = [{
|
|
72
|
-
...
|
|
84
|
+
..._eslint_community_eslint_plugin_eslint_comments_configs.default.recommended,
|
|
73
85
|
name: "component-hook/comments/recommended"
|
|
74
86
|
}, {
|
|
75
87
|
name: "component-hook/comments",
|
|
@@ -125,6 +137,10 @@ const ignores = {
|
|
|
125
137
|
const SRC = "**/*.?([cm])[jt]s?(x)";
|
|
126
138
|
const SRC_EXT = "?([cm])[jt]s?(x)";
|
|
127
139
|
const VUE = "**/*.vue";
|
|
140
|
+
const BLOB_JSON = "**/*.json";
|
|
141
|
+
const JSON5 = "**/*.json5";
|
|
142
|
+
const JSONC = "**/*.jsonc";
|
|
143
|
+
const YAML = "**/*.y?(a)ml";
|
|
128
144
|
|
|
129
145
|
//#endregion
|
|
130
146
|
//#region configs/import.ts
|
|
@@ -147,7 +163,7 @@ const importConfigs = [{
|
|
|
147
163
|
rules: {
|
|
148
164
|
"import/first": "error",
|
|
149
165
|
"import/no-default-export": "error",
|
|
150
|
-
"import/no-duplicates": "error",
|
|
166
|
+
"import/no-duplicates": ["error", { "prefer-inline": true }],
|
|
151
167
|
"import/no-mutable-exports": "error",
|
|
152
168
|
"import/no-named-default": "error",
|
|
153
169
|
"import/no-self-import": "error",
|
|
@@ -159,8 +175,8 @@ const importConfigs = [{
|
|
|
159
175
|
"**/*.d.ts",
|
|
160
176
|
"**/*.md/**",
|
|
161
177
|
`**/*config*.${SRC_EXT}`,
|
|
162
|
-
`**/{views,pages,routes,middleware,plugins,api}/**/*.${SRC_EXT}`,
|
|
163
|
-
`**/{index,vite,esbuild,rollup,rolldown,webpack,rspack,farm,unloader}.${SRC_EXT}`
|
|
178
|
+
`**/{views,pages,routes,middleware,plugins,api,modules}/**/*.${SRC_EXT}`,
|
|
179
|
+
`**/{index,vite,esbuild,rollup,rolldown,webpack,rspack,farm,unloader,nuxt}.${SRC_EXT}`
|
|
164
180
|
],
|
|
165
181
|
plugins: plugins$2,
|
|
166
182
|
languageOptions,
|
|
@@ -169,15 +185,19 @@ const importConfigs = [{
|
|
|
169
185
|
|
|
170
186
|
//#endregion
|
|
171
187
|
//#region configs/javascript.ts
|
|
172
|
-
const isProduction = process.env.NODE_ENV === "production";
|
|
173
188
|
const rules$3 = {
|
|
174
189
|
"no-useless-call": "error",
|
|
175
190
|
"no-useless-computed-key": "error",
|
|
176
191
|
"no-useless-constructor": "error",
|
|
177
192
|
"no-useless-rename": "error",
|
|
178
193
|
"no-var": "error",
|
|
179
|
-
"no-console":
|
|
180
|
-
|
|
194
|
+
"no-console": ["warn", { allow: [
|
|
195
|
+
"warn",
|
|
196
|
+
"error",
|
|
197
|
+
"info",
|
|
198
|
+
"clear"
|
|
199
|
+
] }],
|
|
200
|
+
"no-debugger": "warn",
|
|
181
201
|
"no-eval": "error",
|
|
182
202
|
"no-loop-func": "error",
|
|
183
203
|
"no-dupe-class-members": "error",
|
|
@@ -190,9 +210,18 @@ const rules$3 = {
|
|
|
190
210
|
const jsConfigs = [{
|
|
191
211
|
name: "component-hook/javascript",
|
|
192
212
|
rules: {
|
|
193
|
-
...
|
|
213
|
+
..._eslint_js.default.configs.recommended.rules,
|
|
194
214
|
...rules$3
|
|
195
215
|
}
|
|
216
|
+
}, {
|
|
217
|
+
name: "component-hook/globals",
|
|
218
|
+
languageOptions: {
|
|
219
|
+
ecmaVersion: "latest",
|
|
220
|
+
globals: {
|
|
221
|
+
...globals.default.node,
|
|
222
|
+
...globals.default.browser
|
|
223
|
+
}
|
|
224
|
+
}
|
|
196
225
|
}];
|
|
197
226
|
|
|
198
227
|
//#endregion
|
|
@@ -219,9 +248,225 @@ const jsdocConfig = {
|
|
|
219
248
|
}
|
|
220
249
|
};
|
|
221
250
|
|
|
251
|
+
//#endregion
|
|
252
|
+
//#region configs/jsonc.ts
|
|
253
|
+
const jsoncConfigs = [
|
|
254
|
+
{
|
|
255
|
+
name: "component-hook/jsonc",
|
|
256
|
+
files: [
|
|
257
|
+
BLOB_JSON,
|
|
258
|
+
JSON5,
|
|
259
|
+
JSONC
|
|
260
|
+
],
|
|
261
|
+
plugins: { jsonc: eslint_plugin_jsonc.default },
|
|
262
|
+
languageOptions: { parser: jsonc_eslint_parser.default },
|
|
263
|
+
rules: {
|
|
264
|
+
...eslint_plugin_jsonc.default.configs["recommended-with-jsonc"].rules,
|
|
265
|
+
"jsonc/quote-props": "off",
|
|
266
|
+
"jsonc/quotes": "off"
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
name: "component-hook/jsonc/package-json",
|
|
271
|
+
files: ["**/package.json"],
|
|
272
|
+
rules: {
|
|
273
|
+
"jsonc/sort-array-values": ["error", {
|
|
274
|
+
order: { type: "asc" },
|
|
275
|
+
pathPattern: "^files$"
|
|
276
|
+
}],
|
|
277
|
+
"jsonc/sort-keys": [
|
|
278
|
+
"error",
|
|
279
|
+
{
|
|
280
|
+
order: [
|
|
281
|
+
"publisher",
|
|
282
|
+
"name",
|
|
283
|
+
"displayName",
|
|
284
|
+
"type",
|
|
285
|
+
"version",
|
|
286
|
+
"private",
|
|
287
|
+
"packageManager",
|
|
288
|
+
"description",
|
|
289
|
+
"author",
|
|
290
|
+
"contributors",
|
|
291
|
+
"license",
|
|
292
|
+
"funding",
|
|
293
|
+
"homepage",
|
|
294
|
+
"repository",
|
|
295
|
+
"bugs",
|
|
296
|
+
"keywords",
|
|
297
|
+
"categories",
|
|
298
|
+
"sideEffects",
|
|
299
|
+
"imports",
|
|
300
|
+
"exports",
|
|
301
|
+
"main",
|
|
302
|
+
"module",
|
|
303
|
+
"unpkg",
|
|
304
|
+
"jsdelivr",
|
|
305
|
+
"types",
|
|
306
|
+
"typesVersions",
|
|
307
|
+
"bin",
|
|
308
|
+
"icon",
|
|
309
|
+
"files",
|
|
310
|
+
"engines",
|
|
311
|
+
"activationEvents",
|
|
312
|
+
"contributes",
|
|
313
|
+
"scripts",
|
|
314
|
+
"peerDependencies",
|
|
315
|
+
"peerDependenciesMeta",
|
|
316
|
+
"dependencies",
|
|
317
|
+
"optionalDependencies",
|
|
318
|
+
"devDependencies",
|
|
319
|
+
"pnpm",
|
|
320
|
+
"overrides",
|
|
321
|
+
"resolutions",
|
|
322
|
+
"husky",
|
|
323
|
+
"simple-git-hooks",
|
|
324
|
+
"lint-staged",
|
|
325
|
+
"eslintConfig",
|
|
326
|
+
"prettier",
|
|
327
|
+
"tsdown"
|
|
328
|
+
],
|
|
329
|
+
pathPattern: "^$"
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
order: { type: "asc" },
|
|
333
|
+
pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$"
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
order: [
|
|
337
|
+
"types",
|
|
338
|
+
"require",
|
|
339
|
+
"import",
|
|
340
|
+
"default"
|
|
341
|
+
],
|
|
342
|
+
pathPattern: "^exports.*$"
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
order: { type: "asc" },
|
|
346
|
+
pathPattern: String.raw`^(?:resolutions|overrides|pnpm\.overrides)$`
|
|
347
|
+
}
|
|
348
|
+
]
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
name: "component-hook/jsonc/tsconfig",
|
|
353
|
+
files: ["**/[jt]sconfig.json", "**/[jt]sconfig.*.json"],
|
|
354
|
+
rules: { "jsonc/sort-keys": [
|
|
355
|
+
"error",
|
|
356
|
+
{
|
|
357
|
+
order: [
|
|
358
|
+
"extends",
|
|
359
|
+
"compilerOptions",
|
|
360
|
+
"references",
|
|
361
|
+
"files",
|
|
362
|
+
"include",
|
|
363
|
+
"exclude"
|
|
364
|
+
],
|
|
365
|
+
pathPattern: "^$"
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
order: [
|
|
369
|
+
"incremental",
|
|
370
|
+
"composite",
|
|
371
|
+
"tsBuildInfoFile",
|
|
372
|
+
"disableSourceOfProjectReferenceRedirect",
|
|
373
|
+
"disableSolutionSearching",
|
|
374
|
+
"disableReferencedProjectLoad",
|
|
375
|
+
"target",
|
|
376
|
+
"jsx",
|
|
377
|
+
"jsxFactory",
|
|
378
|
+
"jsxFragmentFactory",
|
|
379
|
+
"jsxImportSource",
|
|
380
|
+
"lib",
|
|
381
|
+
"moduleDetection",
|
|
382
|
+
"noLib",
|
|
383
|
+
"reactNamespace",
|
|
384
|
+
"useDefineForClassFields",
|
|
385
|
+
"emitDecoratorMetadata",
|
|
386
|
+
"experimentalDecorators",
|
|
387
|
+
"libReplacement",
|
|
388
|
+
"baseUrl",
|
|
389
|
+
"rootDir",
|
|
390
|
+
"rootDirs",
|
|
391
|
+
"customConditions",
|
|
392
|
+
"module",
|
|
393
|
+
"moduleResolution",
|
|
394
|
+
"moduleSuffixes",
|
|
395
|
+
"noResolve",
|
|
396
|
+
"paths",
|
|
397
|
+
"resolveJsonModule",
|
|
398
|
+
"resolvePackageJsonExports",
|
|
399
|
+
"resolvePackageJsonImports",
|
|
400
|
+
"typeRoots",
|
|
401
|
+
"types",
|
|
402
|
+
"allowArbitraryExtensions",
|
|
403
|
+
"allowImportingTsExtensions",
|
|
404
|
+
"allowUmdGlobalAccess",
|
|
405
|
+
"allowJs",
|
|
406
|
+
"checkJs",
|
|
407
|
+
"maxNodeModuleJsDepth",
|
|
408
|
+
"strict",
|
|
409
|
+
"strictBindCallApply",
|
|
410
|
+
"strictFunctionTypes",
|
|
411
|
+
"strictNullChecks",
|
|
412
|
+
"strictPropertyInitialization",
|
|
413
|
+
"allowUnreachableCode",
|
|
414
|
+
"allowUnusedLabels",
|
|
415
|
+
"alwaysStrict",
|
|
416
|
+
"exactOptionalPropertyTypes",
|
|
417
|
+
"noFallthroughCasesInSwitch",
|
|
418
|
+
"noImplicitAny",
|
|
419
|
+
"noImplicitOverride",
|
|
420
|
+
"noImplicitReturns",
|
|
421
|
+
"noImplicitThis",
|
|
422
|
+
"noPropertyAccessFromIndexSignature",
|
|
423
|
+
"noUncheckedIndexedAccess",
|
|
424
|
+
"noUnusedLocals",
|
|
425
|
+
"noUnusedParameters",
|
|
426
|
+
"useUnknownInCatchVariables",
|
|
427
|
+
"declaration",
|
|
428
|
+
"declarationDir",
|
|
429
|
+
"declarationMap",
|
|
430
|
+
"downlevelIteration",
|
|
431
|
+
"emitBOM",
|
|
432
|
+
"emitDeclarationOnly",
|
|
433
|
+
"importHelpers",
|
|
434
|
+
"importsNotUsedAsValues",
|
|
435
|
+
"inlineSourceMap",
|
|
436
|
+
"inlineSources",
|
|
437
|
+
"mapRoot",
|
|
438
|
+
"newLine",
|
|
439
|
+
"noEmit",
|
|
440
|
+
"noEmitHelpers",
|
|
441
|
+
"noEmitOnError",
|
|
442
|
+
"outDir",
|
|
443
|
+
"outFile",
|
|
444
|
+
"preserveConstEnums",
|
|
445
|
+
"preserveValueImports",
|
|
446
|
+
"removeComments",
|
|
447
|
+
"sourceMap",
|
|
448
|
+
"sourceRoot",
|
|
449
|
+
"stripInternal",
|
|
450
|
+
"allowSyntheticDefaultImports",
|
|
451
|
+
"esModuleInterop",
|
|
452
|
+
"forceConsistentCasingInFileNames",
|
|
453
|
+
"isolatedDeclarations",
|
|
454
|
+
"isolatedModules",
|
|
455
|
+
"preserveSymlinks",
|
|
456
|
+
"verbatimModuleSyntax",
|
|
457
|
+
"erasableSyntaxOnly",
|
|
458
|
+
"skipDefaultLibCheck",
|
|
459
|
+
"skipLibCheck"
|
|
460
|
+
],
|
|
461
|
+
pathPattern: "^compilerOptions$"
|
|
462
|
+
}
|
|
463
|
+
] }
|
|
464
|
+
}
|
|
465
|
+
];
|
|
466
|
+
|
|
222
467
|
//#endregion
|
|
223
468
|
//#region configs/markdown.ts
|
|
224
|
-
const markdownConfigs = [...
|
|
469
|
+
const markdownConfigs = [..._eslint_markdown.default.configs.processor.map((config) => ({
|
|
225
470
|
...config,
|
|
226
471
|
name: `component-hook/${config.name}`
|
|
227
472
|
})), {
|
|
@@ -254,7 +499,7 @@ const markdownConfigs = [...__eslint_markdown.default.configs.processor.map((con
|
|
|
254
499
|
//#endregion
|
|
255
500
|
//#region configs/perfectionist.ts
|
|
256
501
|
const perfectionistConfig = {
|
|
257
|
-
name: "component-hook/perfectionist/
|
|
502
|
+
name: "component-hook/perfectionist/imports",
|
|
258
503
|
plugins: { perfectionist: eslint_plugin_perfectionist.default },
|
|
259
504
|
rules: {
|
|
260
505
|
"perfectionist/sort-imports": ["error", {
|
|
@@ -262,23 +507,27 @@ const perfectionistConfig = {
|
|
|
262
507
|
"builtin",
|
|
263
508
|
"external",
|
|
264
509
|
"internal",
|
|
265
|
-
"internal-type",
|
|
266
510
|
"parent",
|
|
267
|
-
"
|
|
511
|
+
"subpath",
|
|
268
512
|
"sibling",
|
|
269
|
-
"sibling-type",
|
|
270
513
|
"index",
|
|
271
|
-
"
|
|
272
|
-
"object",
|
|
514
|
+
"style",
|
|
273
515
|
"type",
|
|
274
516
|
"side-effect",
|
|
275
517
|
"side-effect-style"
|
|
276
518
|
],
|
|
277
519
|
internalPattern: ["^[~@#]/.*"],
|
|
278
|
-
newlinesBetween: "ignore"
|
|
520
|
+
newlinesBetween: "ignore",
|
|
521
|
+
type: "natural"
|
|
522
|
+
}],
|
|
523
|
+
"perfectionist/sort-named-exports": ["warn", {
|
|
524
|
+
groups: ["value-export", "type-export"],
|
|
525
|
+
type: "natural"
|
|
279
526
|
}],
|
|
280
|
-
"perfectionist/sort-named-
|
|
281
|
-
|
|
527
|
+
"perfectionist/sort-named-imports": ["warn", {
|
|
528
|
+
groups: ["value-import", "type-import"],
|
|
529
|
+
type: "natural"
|
|
530
|
+
}]
|
|
282
531
|
}
|
|
283
532
|
};
|
|
284
533
|
|
|
@@ -399,7 +648,7 @@ const testingLibraryMarkoConfig = {
|
|
|
399
648
|
|
|
400
649
|
//#endregion
|
|
401
650
|
//#region configs/typescript.ts
|
|
402
|
-
const rules = {
|
|
651
|
+
const rules$1 = {
|
|
403
652
|
"@typescript-eslint/ban-ts-comment": "off",
|
|
404
653
|
"@typescript-eslint/no-explicit-any": "off",
|
|
405
654
|
"@typescript-eslint/no-unsafe-function-type": "off",
|
|
@@ -417,48 +666,56 @@ const typescriptConfigs = typescript_eslint.default.config({
|
|
|
417
666
|
extends: [...typescript_eslint.default.configs.recommended],
|
|
418
667
|
files: ["**/*.ts", "**/*.tsx"],
|
|
419
668
|
name: "component-hook/typescript",
|
|
420
|
-
rules
|
|
669
|
+
rules: rules$1
|
|
421
670
|
});
|
|
422
671
|
|
|
423
672
|
//#endregion
|
|
424
673
|
//#region configs/unicorn.ts
|
|
425
|
-
const unicornConfigs = [
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
674
|
+
const unicornConfigs = [
|
|
675
|
+
{
|
|
676
|
+
...eslint_plugin_unicorn.default.configs.unopinionated,
|
|
677
|
+
name: "component-hook/unicorn/unopinionated"
|
|
678
|
+
},
|
|
679
|
+
{
|
|
680
|
+
name: "component-hook/unicorn",
|
|
681
|
+
rules: {
|
|
682
|
+
"unicorn/catch-error-name": "error",
|
|
683
|
+
"unicorn/consistent-empty-array-spread": "error",
|
|
684
|
+
"unicorn/consistent-function-scoping": ["error", { checkArrowFunctions: false }],
|
|
685
|
+
"unicorn/custom-error-definition": "error",
|
|
686
|
+
"unicorn/filename-case": ["error", {
|
|
687
|
+
cases: {
|
|
688
|
+
kebabCase: true,
|
|
689
|
+
pascalCase: true
|
|
690
|
+
},
|
|
691
|
+
ignore: [/^[A-Z]+\..*$/, /import_map\.json/]
|
|
692
|
+
}],
|
|
693
|
+
"unicorn/import-style": "off",
|
|
694
|
+
"unicorn/no-abusive-eslint-disable": "off",
|
|
695
|
+
"unicorn/no-array-for-each": "off",
|
|
696
|
+
"unicorn/no-empty-file": "off",
|
|
697
|
+
"unicorn/no-for-loop": "error",
|
|
698
|
+
"unicorn/no-process-exit": "off",
|
|
699
|
+
"unicorn/no-this-assignment": "off",
|
|
700
|
+
"unicorn/no-unreadable-array-destructuring": "off",
|
|
701
|
+
"unicorn/no-useless-undefined": ["error", {
|
|
702
|
+
checkArguments: false,
|
|
703
|
+
checkArrowFunctionBody: false
|
|
704
|
+
}],
|
|
705
|
+
"unicorn/numeric-separators-style": "off",
|
|
706
|
+
"unicorn/prefer-module": "off",
|
|
707
|
+
"unicorn/prefer-query-selector": "error",
|
|
708
|
+
"unicorn/prefer-ternary": "off",
|
|
709
|
+
"unicorn/prefer-top-level-await": "off",
|
|
710
|
+
"unicorn/require-module-specifiers": "off"
|
|
711
|
+
}
|
|
712
|
+
},
|
|
713
|
+
{
|
|
714
|
+
name: "component-hook/unicorn/locales",
|
|
715
|
+
files: ["**/locales/**/*.json"],
|
|
716
|
+
rules: { "unicorn/filename-case": "off" }
|
|
460
717
|
}
|
|
461
|
-
|
|
718
|
+
];
|
|
462
719
|
|
|
463
720
|
//#endregion
|
|
464
721
|
//#region configs/vue.ts
|
|
@@ -466,7 +723,7 @@ const recommendedRules = eslint_plugin_vue.default.configs["flat/recommended"].m
|
|
|
466
723
|
...acc,
|
|
467
724
|
...rules$4
|
|
468
725
|
}), {});
|
|
469
|
-
const rules
|
|
726
|
+
const rules = {
|
|
470
727
|
"vue/block-order": ["error", { order: [
|
|
471
728
|
"script",
|
|
472
729
|
"template",
|
|
@@ -516,7 +773,7 @@ const eslintConfigTypescript = typescript_eslint.default.config({
|
|
|
516
773
|
extends: extendsTypescript,
|
|
517
774
|
files: [VUE],
|
|
518
775
|
name: "component-hook/vue/typescript",
|
|
519
|
-
rules
|
|
776
|
+
rules: rules$1
|
|
520
777
|
});
|
|
521
778
|
const vueConfigs = [
|
|
522
779
|
...eslintConfigTypescript,
|
|
@@ -557,11 +814,53 @@ const vueConfigs = [
|
|
|
557
814
|
processor: eslint_plugin_vue.default.processors[".vue"],
|
|
558
815
|
rules: {
|
|
559
816
|
...recommendedRules,
|
|
560
|
-
...rules
|
|
817
|
+
...rules
|
|
561
818
|
}
|
|
562
819
|
}
|
|
563
820
|
];
|
|
564
821
|
|
|
822
|
+
//#endregion
|
|
823
|
+
//#region configs/yaml.ts
|
|
824
|
+
const yamlConfigs = [{
|
|
825
|
+
name: "component-hook/yaml",
|
|
826
|
+
files: [YAML],
|
|
827
|
+
plugins: { yml: eslint_plugin_yml.default },
|
|
828
|
+
languageOptions: { parser: yaml_eslint_parser.default },
|
|
829
|
+
rules: {
|
|
830
|
+
...eslint_plugin_yml.default.configs.standard.rules,
|
|
831
|
+
...eslint_plugin_yml.default.configs.prettier.rules,
|
|
832
|
+
"yml/no-empty-mapping-value": "off"
|
|
833
|
+
}
|
|
834
|
+
}, {
|
|
835
|
+
name: "component-hook/yaml/pnpm-workspace",
|
|
836
|
+
files: ["**/pnpm-workspace.yaml"],
|
|
837
|
+
rules: { "yml/sort-keys": [
|
|
838
|
+
"error",
|
|
839
|
+
{
|
|
840
|
+
order: [
|
|
841
|
+
"packages",
|
|
842
|
+
"overrides",
|
|
843
|
+
"patchedDependencies",
|
|
844
|
+
"defines",
|
|
845
|
+
"catalog",
|
|
846
|
+
"catalogs",
|
|
847
|
+
{ order: { type: "asc" } }
|
|
848
|
+
],
|
|
849
|
+
pathPattern: "^$"
|
|
850
|
+
},
|
|
851
|
+
{
|
|
852
|
+
allowLineSeparatedGroups: true,
|
|
853
|
+
order: { type: "asc" },
|
|
854
|
+
pathPattern: "^(catalog|catalogs|overrides)$"
|
|
855
|
+
},
|
|
856
|
+
{
|
|
857
|
+
allowLineSeparatedGroups: true,
|
|
858
|
+
order: { type: "asc" },
|
|
859
|
+
pathPattern: String.raw`^catalogs\..+$`
|
|
860
|
+
}
|
|
861
|
+
] }
|
|
862
|
+
}];
|
|
863
|
+
|
|
565
864
|
//#endregion
|
|
566
865
|
//#region index.ts
|
|
567
866
|
const basicConfigs = [
|
|
@@ -574,16 +873,8 @@ const basicConfigs = [
|
|
|
574
873
|
regexpConfig,
|
|
575
874
|
deMorganConfig,
|
|
576
875
|
perfectionistConfig,
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
languageOptions: {
|
|
580
|
-
ecmaVersion: "latest",
|
|
581
|
-
globals: {
|
|
582
|
-
...globals.default.node,
|
|
583
|
-
...globals.default.browser
|
|
584
|
-
}
|
|
585
|
-
}
|
|
586
|
-
},
|
|
876
|
+
...jsoncConfigs,
|
|
877
|
+
...yamlConfigs,
|
|
587
878
|
ignores
|
|
588
879
|
];
|
|
589
880
|
const configs = {
|