@component-hook/eslint-plugin 1.3.2 → 1.4.0
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/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/dist/index.mjs
CHANGED
|
@@ -20,6 +20,10 @@ import pluginUnicorn from "eslint-plugin-unicorn";
|
|
|
20
20
|
import pluginDeMorgan from "eslint-plugin-de-morgan";
|
|
21
21
|
import pluginPerfectionist from "eslint-plugin-perfectionist";
|
|
22
22
|
import pluginJsdoc from "eslint-plugin-jsdoc";
|
|
23
|
+
import pluginJsonc from "eslint-plugin-jsonc";
|
|
24
|
+
import parserJsonc from "jsonc-eslint-parser";
|
|
25
|
+
import pluginYaml from "eslint-plugin-yml";
|
|
26
|
+
import parserYaml from "yaml-eslint-parser";
|
|
23
27
|
|
|
24
28
|
//#region configs/comments.ts
|
|
25
29
|
const commentsConfigs = [{
|
|
@@ -79,6 +83,10 @@ const ignores = {
|
|
|
79
83
|
const SRC = "**/*.?([cm])[jt]s?(x)";
|
|
80
84
|
const SRC_EXT = "?([cm])[jt]s?(x)";
|
|
81
85
|
const VUE = "**/*.vue";
|
|
86
|
+
const BLOB_JSON = "**/*.json";
|
|
87
|
+
const JSON5 = "**/*.json5";
|
|
88
|
+
const JSONC = "**/*.jsonc";
|
|
89
|
+
const YAML = "**/*.y?(a)ml";
|
|
82
90
|
|
|
83
91
|
//#endregion
|
|
84
92
|
//#region configs/import.ts
|
|
@@ -101,7 +109,7 @@ const importConfigs = [{
|
|
|
101
109
|
rules: {
|
|
102
110
|
"import/first": "error",
|
|
103
111
|
"import/no-default-export": "error",
|
|
104
|
-
"import/no-duplicates": "error",
|
|
112
|
+
"import/no-duplicates": ["error", { "prefer-inline": true }],
|
|
105
113
|
"import/no-mutable-exports": "error",
|
|
106
114
|
"import/no-named-default": "error",
|
|
107
115
|
"import/no-self-import": "error",
|
|
@@ -113,8 +121,8 @@ const importConfigs = [{
|
|
|
113
121
|
"**/*.d.ts",
|
|
114
122
|
"**/*.md/**",
|
|
115
123
|
`**/*config*.${SRC_EXT}`,
|
|
116
|
-
`**/{views,pages,routes,middleware,plugins,api}/**/*.${SRC_EXT}`,
|
|
117
|
-
`**/{index,vite,esbuild,rollup,rolldown,webpack,rspack,farm,unloader}.${SRC_EXT}`
|
|
124
|
+
`**/{views,pages,routes,middleware,plugins,api,modules}/**/*.${SRC_EXT}`,
|
|
125
|
+
`**/{index,vite,esbuild,rollup,rolldown,webpack,rspack,farm,unloader,nuxt}.${SRC_EXT}`
|
|
118
126
|
],
|
|
119
127
|
plugins: plugins$2,
|
|
120
128
|
languageOptions,
|
|
@@ -123,15 +131,19 @@ const importConfigs = [{
|
|
|
123
131
|
|
|
124
132
|
//#endregion
|
|
125
133
|
//#region configs/javascript.ts
|
|
126
|
-
const isProduction = process.env.NODE_ENV === "production";
|
|
127
134
|
const rules$3 = {
|
|
128
135
|
"no-useless-call": "error",
|
|
129
136
|
"no-useless-computed-key": "error",
|
|
130
137
|
"no-useless-constructor": "error",
|
|
131
138
|
"no-useless-rename": "error",
|
|
132
139
|
"no-var": "error",
|
|
133
|
-
"no-console":
|
|
134
|
-
|
|
140
|
+
"no-console": ["warn", { allow: [
|
|
141
|
+
"warn",
|
|
142
|
+
"error",
|
|
143
|
+
"info",
|
|
144
|
+
"clear"
|
|
145
|
+
] }],
|
|
146
|
+
"no-debugger": "warn",
|
|
135
147
|
"no-eval": "error",
|
|
136
148
|
"no-loop-func": "error",
|
|
137
149
|
"no-dupe-class-members": "error",
|
|
@@ -147,6 +159,15 @@ const jsConfigs = [{
|
|
|
147
159
|
...pluginJs.configs.recommended.rules,
|
|
148
160
|
...rules$3
|
|
149
161
|
}
|
|
162
|
+
}, {
|
|
163
|
+
name: "component-hook/globals",
|
|
164
|
+
languageOptions: {
|
|
165
|
+
ecmaVersion: "latest",
|
|
166
|
+
globals: {
|
|
167
|
+
...globals.node,
|
|
168
|
+
...globals.browser
|
|
169
|
+
}
|
|
170
|
+
}
|
|
150
171
|
}];
|
|
151
172
|
|
|
152
173
|
//#endregion
|
|
@@ -173,6 +194,222 @@ const jsdocConfig = {
|
|
|
173
194
|
}
|
|
174
195
|
};
|
|
175
196
|
|
|
197
|
+
//#endregion
|
|
198
|
+
//#region configs/jsonc.ts
|
|
199
|
+
const jsoncConfigs = [
|
|
200
|
+
{
|
|
201
|
+
name: "component-hook/jsonc",
|
|
202
|
+
files: [
|
|
203
|
+
BLOB_JSON,
|
|
204
|
+
JSON5,
|
|
205
|
+
JSONC
|
|
206
|
+
],
|
|
207
|
+
plugins: { jsonc: pluginJsonc },
|
|
208
|
+
languageOptions: { parser: parserJsonc },
|
|
209
|
+
rules: {
|
|
210
|
+
...pluginJsonc.configs["recommended-with-jsonc"].rules,
|
|
211
|
+
"jsonc/quote-props": "off",
|
|
212
|
+
"jsonc/quotes": "off"
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
name: "component-hook/jsonc/package-json",
|
|
217
|
+
files: ["**/package.json"],
|
|
218
|
+
rules: {
|
|
219
|
+
"jsonc/sort-array-values": ["error", {
|
|
220
|
+
order: { type: "asc" },
|
|
221
|
+
pathPattern: "^files$"
|
|
222
|
+
}],
|
|
223
|
+
"jsonc/sort-keys": [
|
|
224
|
+
"error",
|
|
225
|
+
{
|
|
226
|
+
order: [
|
|
227
|
+
"publisher",
|
|
228
|
+
"name",
|
|
229
|
+
"displayName",
|
|
230
|
+
"type",
|
|
231
|
+
"version",
|
|
232
|
+
"private",
|
|
233
|
+
"packageManager",
|
|
234
|
+
"description",
|
|
235
|
+
"author",
|
|
236
|
+
"contributors",
|
|
237
|
+
"license",
|
|
238
|
+
"funding",
|
|
239
|
+
"homepage",
|
|
240
|
+
"repository",
|
|
241
|
+
"bugs",
|
|
242
|
+
"keywords",
|
|
243
|
+
"categories",
|
|
244
|
+
"sideEffects",
|
|
245
|
+
"imports",
|
|
246
|
+
"exports",
|
|
247
|
+
"main",
|
|
248
|
+
"module",
|
|
249
|
+
"unpkg",
|
|
250
|
+
"jsdelivr",
|
|
251
|
+
"types",
|
|
252
|
+
"typesVersions",
|
|
253
|
+
"bin",
|
|
254
|
+
"icon",
|
|
255
|
+
"files",
|
|
256
|
+
"engines",
|
|
257
|
+
"activationEvents",
|
|
258
|
+
"contributes",
|
|
259
|
+
"scripts",
|
|
260
|
+
"peerDependencies",
|
|
261
|
+
"peerDependenciesMeta",
|
|
262
|
+
"dependencies",
|
|
263
|
+
"optionalDependencies",
|
|
264
|
+
"devDependencies",
|
|
265
|
+
"pnpm",
|
|
266
|
+
"overrides",
|
|
267
|
+
"resolutions",
|
|
268
|
+
"husky",
|
|
269
|
+
"simple-git-hooks",
|
|
270
|
+
"lint-staged",
|
|
271
|
+
"eslintConfig",
|
|
272
|
+
"prettier",
|
|
273
|
+
"tsdown"
|
|
274
|
+
],
|
|
275
|
+
pathPattern: "^$"
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
order: { type: "asc" },
|
|
279
|
+
pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$"
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
order: [
|
|
283
|
+
"types",
|
|
284
|
+
"require",
|
|
285
|
+
"import",
|
|
286
|
+
"default"
|
|
287
|
+
],
|
|
288
|
+
pathPattern: "^exports.*$"
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
order: { type: "asc" },
|
|
292
|
+
pathPattern: String.raw`^(?:resolutions|overrides|pnpm\.overrides)$`
|
|
293
|
+
}
|
|
294
|
+
]
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
name: "component-hook/jsonc/tsconfig",
|
|
299
|
+
files: ["**/[jt]sconfig.json", "**/[jt]sconfig.*.json"],
|
|
300
|
+
rules: { "jsonc/sort-keys": [
|
|
301
|
+
"error",
|
|
302
|
+
{
|
|
303
|
+
order: [
|
|
304
|
+
"extends",
|
|
305
|
+
"compilerOptions",
|
|
306
|
+
"references",
|
|
307
|
+
"files",
|
|
308
|
+
"include",
|
|
309
|
+
"exclude"
|
|
310
|
+
],
|
|
311
|
+
pathPattern: "^$"
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
order: [
|
|
315
|
+
"incremental",
|
|
316
|
+
"composite",
|
|
317
|
+
"tsBuildInfoFile",
|
|
318
|
+
"disableSourceOfProjectReferenceRedirect",
|
|
319
|
+
"disableSolutionSearching",
|
|
320
|
+
"disableReferencedProjectLoad",
|
|
321
|
+
"target",
|
|
322
|
+
"jsx",
|
|
323
|
+
"jsxFactory",
|
|
324
|
+
"jsxFragmentFactory",
|
|
325
|
+
"jsxImportSource",
|
|
326
|
+
"lib",
|
|
327
|
+
"moduleDetection",
|
|
328
|
+
"noLib",
|
|
329
|
+
"reactNamespace",
|
|
330
|
+
"useDefineForClassFields",
|
|
331
|
+
"emitDecoratorMetadata",
|
|
332
|
+
"experimentalDecorators",
|
|
333
|
+
"libReplacement",
|
|
334
|
+
"baseUrl",
|
|
335
|
+
"rootDir",
|
|
336
|
+
"rootDirs",
|
|
337
|
+
"customConditions",
|
|
338
|
+
"module",
|
|
339
|
+
"moduleResolution",
|
|
340
|
+
"moduleSuffixes",
|
|
341
|
+
"noResolve",
|
|
342
|
+
"paths",
|
|
343
|
+
"resolveJsonModule",
|
|
344
|
+
"resolvePackageJsonExports",
|
|
345
|
+
"resolvePackageJsonImports",
|
|
346
|
+
"typeRoots",
|
|
347
|
+
"types",
|
|
348
|
+
"allowArbitraryExtensions",
|
|
349
|
+
"allowImportingTsExtensions",
|
|
350
|
+
"allowUmdGlobalAccess",
|
|
351
|
+
"allowJs",
|
|
352
|
+
"checkJs",
|
|
353
|
+
"maxNodeModuleJsDepth",
|
|
354
|
+
"strict",
|
|
355
|
+
"strictBindCallApply",
|
|
356
|
+
"strictFunctionTypes",
|
|
357
|
+
"strictNullChecks",
|
|
358
|
+
"strictPropertyInitialization",
|
|
359
|
+
"allowUnreachableCode",
|
|
360
|
+
"allowUnusedLabels",
|
|
361
|
+
"alwaysStrict",
|
|
362
|
+
"exactOptionalPropertyTypes",
|
|
363
|
+
"noFallthroughCasesInSwitch",
|
|
364
|
+
"noImplicitAny",
|
|
365
|
+
"noImplicitOverride",
|
|
366
|
+
"noImplicitReturns",
|
|
367
|
+
"noImplicitThis",
|
|
368
|
+
"noPropertyAccessFromIndexSignature",
|
|
369
|
+
"noUncheckedIndexedAccess",
|
|
370
|
+
"noUnusedLocals",
|
|
371
|
+
"noUnusedParameters",
|
|
372
|
+
"useUnknownInCatchVariables",
|
|
373
|
+
"declaration",
|
|
374
|
+
"declarationDir",
|
|
375
|
+
"declarationMap",
|
|
376
|
+
"downlevelIteration",
|
|
377
|
+
"emitBOM",
|
|
378
|
+
"emitDeclarationOnly",
|
|
379
|
+
"importHelpers",
|
|
380
|
+
"importsNotUsedAsValues",
|
|
381
|
+
"inlineSourceMap",
|
|
382
|
+
"inlineSources",
|
|
383
|
+
"mapRoot",
|
|
384
|
+
"newLine",
|
|
385
|
+
"noEmit",
|
|
386
|
+
"noEmitHelpers",
|
|
387
|
+
"noEmitOnError",
|
|
388
|
+
"outDir",
|
|
389
|
+
"outFile",
|
|
390
|
+
"preserveConstEnums",
|
|
391
|
+
"preserveValueImports",
|
|
392
|
+
"removeComments",
|
|
393
|
+
"sourceMap",
|
|
394
|
+
"sourceRoot",
|
|
395
|
+
"stripInternal",
|
|
396
|
+
"allowSyntheticDefaultImports",
|
|
397
|
+
"esModuleInterop",
|
|
398
|
+
"forceConsistentCasingInFileNames",
|
|
399
|
+
"isolatedDeclarations",
|
|
400
|
+
"isolatedModules",
|
|
401
|
+
"preserveSymlinks",
|
|
402
|
+
"verbatimModuleSyntax",
|
|
403
|
+
"erasableSyntaxOnly",
|
|
404
|
+
"skipDefaultLibCheck",
|
|
405
|
+
"skipLibCheck"
|
|
406
|
+
],
|
|
407
|
+
pathPattern: "^compilerOptions$"
|
|
408
|
+
}
|
|
409
|
+
] }
|
|
410
|
+
}
|
|
411
|
+
];
|
|
412
|
+
|
|
176
413
|
//#endregion
|
|
177
414
|
//#region configs/markdown.ts
|
|
178
415
|
const markdownConfigs = [...pluginMarkdown.configs.processor.map((config) => ({
|
|
@@ -208,7 +445,7 @@ const markdownConfigs = [...pluginMarkdown.configs.processor.map((config) => ({
|
|
|
208
445
|
//#endregion
|
|
209
446
|
//#region configs/perfectionist.ts
|
|
210
447
|
const perfectionistConfig = {
|
|
211
|
-
name: "component-hook/perfectionist/
|
|
448
|
+
name: "component-hook/perfectionist/imports",
|
|
212
449
|
plugins: { perfectionist: pluginPerfectionist },
|
|
213
450
|
rules: {
|
|
214
451
|
"perfectionist/sort-imports": ["error", {
|
|
@@ -216,23 +453,27 @@ const perfectionistConfig = {
|
|
|
216
453
|
"builtin",
|
|
217
454
|
"external",
|
|
218
455
|
"internal",
|
|
219
|
-
"internal-type",
|
|
220
456
|
"parent",
|
|
221
|
-
"
|
|
457
|
+
"subpath",
|
|
222
458
|
"sibling",
|
|
223
|
-
"sibling-type",
|
|
224
459
|
"index",
|
|
225
|
-
"
|
|
226
|
-
"object",
|
|
460
|
+
"style",
|
|
227
461
|
"type",
|
|
228
462
|
"side-effect",
|
|
229
463
|
"side-effect-style"
|
|
230
464
|
],
|
|
231
465
|
internalPattern: ["^[~@#]/.*"],
|
|
232
|
-
newlinesBetween: "ignore"
|
|
466
|
+
newlinesBetween: "ignore",
|
|
467
|
+
type: "natural"
|
|
468
|
+
}],
|
|
469
|
+
"perfectionist/sort-named-exports": ["warn", {
|
|
470
|
+
groups: ["value-export", "type-export"],
|
|
471
|
+
type: "natural"
|
|
233
472
|
}],
|
|
234
|
-
"perfectionist/sort-named-
|
|
235
|
-
|
|
473
|
+
"perfectionist/sort-named-imports": ["warn", {
|
|
474
|
+
groups: ["value-import", "type-import"],
|
|
475
|
+
type: "natural"
|
|
476
|
+
}]
|
|
236
477
|
}
|
|
237
478
|
};
|
|
238
479
|
|
|
@@ -353,7 +594,7 @@ const testingLibraryMarkoConfig = {
|
|
|
353
594
|
|
|
354
595
|
//#endregion
|
|
355
596
|
//#region configs/typescript.ts
|
|
356
|
-
const rules = {
|
|
597
|
+
const rules$1 = {
|
|
357
598
|
"@typescript-eslint/ban-ts-comment": "off",
|
|
358
599
|
"@typescript-eslint/no-explicit-any": "off",
|
|
359
600
|
"@typescript-eslint/no-unsafe-function-type": "off",
|
|
@@ -371,48 +612,56 @@ const typescriptConfigs = typescriptEslint.config({
|
|
|
371
612
|
extends: [...typescriptEslint.configs.recommended],
|
|
372
613
|
files: ["**/*.ts", "**/*.tsx"],
|
|
373
614
|
name: "component-hook/typescript",
|
|
374
|
-
rules
|
|
615
|
+
rules: rules$1
|
|
375
616
|
});
|
|
376
617
|
|
|
377
618
|
//#endregion
|
|
378
619
|
//#region configs/unicorn.ts
|
|
379
|
-
const unicornConfigs = [
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
620
|
+
const unicornConfigs = [
|
|
621
|
+
{
|
|
622
|
+
...pluginUnicorn.configs.unopinionated,
|
|
623
|
+
name: "component-hook/unicorn/unopinionated"
|
|
624
|
+
},
|
|
625
|
+
{
|
|
626
|
+
name: "component-hook/unicorn",
|
|
627
|
+
rules: {
|
|
628
|
+
"unicorn/catch-error-name": "error",
|
|
629
|
+
"unicorn/consistent-empty-array-spread": "error",
|
|
630
|
+
"unicorn/consistent-function-scoping": ["error", { checkArrowFunctions: false }],
|
|
631
|
+
"unicorn/custom-error-definition": "error",
|
|
632
|
+
"unicorn/filename-case": ["error", {
|
|
633
|
+
cases: {
|
|
634
|
+
kebabCase: true,
|
|
635
|
+
pascalCase: true
|
|
636
|
+
},
|
|
637
|
+
ignore: [/^[A-Z]+\..*$/, /import_map\.json/]
|
|
638
|
+
}],
|
|
639
|
+
"unicorn/import-style": "off",
|
|
640
|
+
"unicorn/no-abusive-eslint-disable": "off",
|
|
641
|
+
"unicorn/no-array-for-each": "off",
|
|
642
|
+
"unicorn/no-empty-file": "off",
|
|
643
|
+
"unicorn/no-for-loop": "error",
|
|
644
|
+
"unicorn/no-process-exit": "off",
|
|
645
|
+
"unicorn/no-this-assignment": "off",
|
|
646
|
+
"unicorn/no-unreadable-array-destructuring": "off",
|
|
647
|
+
"unicorn/no-useless-undefined": ["error", {
|
|
648
|
+
checkArguments: false,
|
|
649
|
+
checkArrowFunctionBody: false
|
|
650
|
+
}],
|
|
651
|
+
"unicorn/numeric-separators-style": "off",
|
|
652
|
+
"unicorn/prefer-module": "off",
|
|
653
|
+
"unicorn/prefer-query-selector": "error",
|
|
654
|
+
"unicorn/prefer-ternary": "off",
|
|
655
|
+
"unicorn/prefer-top-level-await": "off",
|
|
656
|
+
"unicorn/require-module-specifiers": "off"
|
|
657
|
+
}
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
name: "component-hook/unicorn/locales",
|
|
661
|
+
files: ["**/locales/**/*.json"],
|
|
662
|
+
rules: { "unicorn/filename-case": "off" }
|
|
414
663
|
}
|
|
415
|
-
|
|
664
|
+
];
|
|
416
665
|
|
|
417
666
|
//#endregion
|
|
418
667
|
//#region configs/vue.ts
|
|
@@ -420,7 +669,7 @@ const recommendedRules = pluginVue.configs["flat/recommended"].map((config) => c
|
|
|
420
669
|
...acc,
|
|
421
670
|
...rules$4
|
|
422
671
|
}), {});
|
|
423
|
-
const rules
|
|
672
|
+
const rules = {
|
|
424
673
|
"vue/block-order": ["error", { order: [
|
|
425
674
|
"script",
|
|
426
675
|
"template",
|
|
@@ -470,7 +719,7 @@ const eslintConfigTypescript = typescriptEslint.config({
|
|
|
470
719
|
extends: extendsTypescript,
|
|
471
720
|
files: [VUE],
|
|
472
721
|
name: "component-hook/vue/typescript",
|
|
473
|
-
rules
|
|
722
|
+
rules: rules$1
|
|
474
723
|
});
|
|
475
724
|
const vueConfigs = [
|
|
476
725
|
...eslintConfigTypescript,
|
|
@@ -511,11 +760,53 @@ const vueConfigs = [
|
|
|
511
760
|
processor: pluginVue.processors[".vue"],
|
|
512
761
|
rules: {
|
|
513
762
|
...recommendedRules,
|
|
514
|
-
...rules
|
|
763
|
+
...rules
|
|
515
764
|
}
|
|
516
765
|
}
|
|
517
766
|
];
|
|
518
767
|
|
|
768
|
+
//#endregion
|
|
769
|
+
//#region configs/yaml.ts
|
|
770
|
+
const yamlConfigs = [{
|
|
771
|
+
name: "component-hook/yaml",
|
|
772
|
+
files: [YAML],
|
|
773
|
+
plugins: { yml: pluginYaml },
|
|
774
|
+
languageOptions: { parser: parserYaml },
|
|
775
|
+
rules: {
|
|
776
|
+
...pluginYaml.configs.standard.rules,
|
|
777
|
+
...pluginYaml.configs.prettier.rules,
|
|
778
|
+
"yml/no-empty-mapping-value": "off"
|
|
779
|
+
}
|
|
780
|
+
}, {
|
|
781
|
+
name: "component-hook/yaml/pnpm-workspace",
|
|
782
|
+
files: ["**/pnpm-workspace.yaml"],
|
|
783
|
+
rules: { "yml/sort-keys": [
|
|
784
|
+
"error",
|
|
785
|
+
{
|
|
786
|
+
order: [
|
|
787
|
+
"packages",
|
|
788
|
+
"overrides",
|
|
789
|
+
"patchedDependencies",
|
|
790
|
+
"defines",
|
|
791
|
+
"catalog",
|
|
792
|
+
"catalogs",
|
|
793
|
+
{ order: { type: "asc" } }
|
|
794
|
+
],
|
|
795
|
+
pathPattern: "^$"
|
|
796
|
+
},
|
|
797
|
+
{
|
|
798
|
+
allowLineSeparatedGroups: true,
|
|
799
|
+
order: { type: "asc" },
|
|
800
|
+
pathPattern: "^(catalog|catalogs|overrides)$"
|
|
801
|
+
},
|
|
802
|
+
{
|
|
803
|
+
allowLineSeparatedGroups: true,
|
|
804
|
+
order: { type: "asc" },
|
|
805
|
+
pathPattern: String.raw`^catalogs\..+$`
|
|
806
|
+
}
|
|
807
|
+
] }
|
|
808
|
+
}];
|
|
809
|
+
|
|
519
810
|
//#endregion
|
|
520
811
|
//#region index.ts
|
|
521
812
|
const basicConfigs = [
|
|
@@ -528,16 +819,8 @@ const basicConfigs = [
|
|
|
528
819
|
regexpConfig,
|
|
529
820
|
deMorganConfig,
|
|
530
821
|
perfectionistConfig,
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
languageOptions: {
|
|
534
|
-
ecmaVersion: "latest",
|
|
535
|
-
globals: {
|
|
536
|
-
...globals.node,
|
|
537
|
-
...globals.browser
|
|
538
|
-
}
|
|
539
|
-
}
|
|
540
|
-
},
|
|
822
|
+
...jsoncConfigs,
|
|
823
|
+
...yamlConfigs,
|
|
541
824
|
ignores
|
|
542
825
|
];
|
|
543
826
|
const configs = {
|
package/package.json
CHANGED
|
@@ -1,76 +1,83 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@component-hook/eslint-plugin",
|
|
3
|
-
"version": "1.3.2",
|
|
4
|
-
"description": "ESLint config for component hook",
|
|
5
|
-
"license": "MIT",
|
|
6
3
|
"type": "module",
|
|
4
|
+
"version": "1.4.0",
|
|
5
|
+
"description": "ESLint config for component hook",
|
|
7
6
|
"author": "Tzuyi",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"homepage": "https://github.com/tzuyi0817/component-hook/tree/master/packages/eslint-plugin#readme",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/tzuyi0817/component-hook.git",
|
|
12
|
+
"directory": "packages/eslint-plugin"
|
|
13
|
+
},
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/tzuyi0817/component-hook/issues"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"eslint",
|
|
19
|
+
"eslintplugin",
|
|
20
|
+
"eslint-plugin"
|
|
21
|
+
],
|
|
8
22
|
"exports": {
|
|
9
23
|
".": {
|
|
10
|
-
"import": {
|
|
11
|
-
"types": "./dist/index.d.mts",
|
|
12
|
-
"default": "./dist/index.mjs"
|
|
13
|
-
},
|
|
14
24
|
"require": {
|
|
15
25
|
"types": "./dist/index.d.cts",
|
|
16
26
|
"default": "./dist/index.cjs"
|
|
27
|
+
},
|
|
28
|
+
"import": {
|
|
29
|
+
"types": "./dist/index.d.mts",
|
|
30
|
+
"default": "./dist/index.mjs"
|
|
17
31
|
}
|
|
18
32
|
}
|
|
19
33
|
},
|
|
20
|
-
"homepage": "https://github.com/tzuyi0817/component-hook/tree/master/packages/eslint-plugin#readme",
|
|
21
|
-
"bugs": {
|
|
22
|
-
"url": "https://github.com/tzuyi0817/component-hook/issues"
|
|
23
|
-
},
|
|
24
|
-
"repository": {
|
|
25
|
-
"type": "git",
|
|
26
|
-
"url": "https://github.com/tzuyi0817/component-hook.git",
|
|
27
|
-
"directory": "packages/eslint-plugin"
|
|
28
|
-
},
|
|
29
34
|
"files": [
|
|
30
35
|
"dist"
|
|
31
36
|
],
|
|
32
37
|
"publishConfig": {
|
|
33
38
|
"tag": "latest"
|
|
34
39
|
},
|
|
35
|
-
"keywords": [
|
|
36
|
-
"eslint",
|
|
37
|
-
"eslintplugin",
|
|
38
|
-
"eslint-plugin"
|
|
39
|
-
],
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"eslint": "^9.39.
|
|
41
|
+
"eslint": "^9.39.2"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
|
|
45
|
-
"@eslint/js": "^9.39.
|
|
45
|
+
"@eslint/js": "^9.39.2",
|
|
46
46
|
"@eslint/markdown": "^7.5.1",
|
|
47
47
|
"eslint-config-prettier": "^10.1.8",
|
|
48
48
|
"eslint-plugin-de-morgan": "^2.0.0",
|
|
49
49
|
"eslint-plugin-import": "^2.32.0",
|
|
50
|
-
"eslint-plugin-jsdoc": "^61.1
|
|
50
|
+
"eslint-plugin-jsdoc": "^61.7.1",
|
|
51
|
+
"eslint-plugin-jsonc": "^2.21.0",
|
|
51
52
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
52
|
-
"eslint-plugin-perfectionist": "^
|
|
53
|
-
"eslint-plugin-playwright": "^2.
|
|
53
|
+
"eslint-plugin-perfectionist": "^5.3.1",
|
|
54
|
+
"eslint-plugin-playwright": "^2.4.0",
|
|
54
55
|
"eslint-plugin-prettier": "^5.5.4",
|
|
55
56
|
"eslint-plugin-react": "^7.37.5",
|
|
56
57
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
57
58
|
"eslint-plugin-regexp": "^2.10.0",
|
|
58
59
|
"eslint-plugin-security": "^3.0.1",
|
|
59
60
|
"eslint-plugin-sonarjs": "^3.0.5",
|
|
60
|
-
"eslint-plugin-testing-library": "^7.
|
|
61
|
+
"eslint-plugin-testing-library": "^7.15.4",
|
|
61
62
|
"eslint-plugin-unicorn": "^62.0.0",
|
|
62
|
-
"eslint-plugin-vue": "^10.
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
63
|
+
"eslint-plugin-vue": "^10.6.2",
|
|
64
|
+
"eslint-plugin-yml": "^1.19.1",
|
|
65
|
+
"globals": "^17.0.0",
|
|
66
|
+
"jsonc-eslint-parser": "^2.4.2",
|
|
67
|
+
"typescript-eslint": "^8.52.0",
|
|
68
|
+
"vue-eslint-parser": "^10.2.0",
|
|
69
|
+
"yaml-eslint-parser": "^1.3.2"
|
|
66
70
|
},
|
|
67
71
|
"devDependencies": {
|
|
68
|
-
"@eslint/config-inspector": "^1.
|
|
69
|
-
"@types/eslint-plugin-security": "^3.0.0"
|
|
72
|
+
"@eslint/config-inspector": "^1.4.2",
|
|
73
|
+
"@types/eslint-plugin-security": "^3.0.0",
|
|
74
|
+
"eslint-typegen": "^2.3.0",
|
|
75
|
+
"unrun": "^0.2.24"
|
|
70
76
|
},
|
|
71
77
|
"scripts": {
|
|
72
78
|
"dev": "eslint-config-inspector --config ../../eslint.config.js",
|
|
73
|
-
"build": "tsdown",
|
|
79
|
+
"build": "pnpm run build:typegen && tsdown",
|
|
80
|
+
"build:typegen": "unrun scripts/typegen.ts",
|
|
74
81
|
"typecheck": "tsc --noEmit --skipLibCheck"
|
|
75
82
|
}
|
|
76
83
|
}
|