@favorodera/eslint-config 0.0.2 → 0.0.3
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 +408 -73
- package/dist/index.d.cts +480 -4
- package/dist/index.d.mts +480 -4
- package/dist/index.mjs +408 -73
- package/package.json +30 -27
package/dist/index.cjs
CHANGED
|
@@ -29,18 +29,17 @@ eslint_processor_vue_blocks = __toESM(eslint_processor_vue_blocks, 1);
|
|
|
29
29
|
let globals = require("globals");
|
|
30
30
|
globals = __toESM(globals, 1);
|
|
31
31
|
//#region src/globs.ts
|
|
32
|
-
/** Glob pattern for JavaScript linting */
|
|
33
32
|
const jsGlob = "**/*.{js,cjs,mjs}";
|
|
34
|
-
/** Glob pattern for TypeScript linting */
|
|
35
33
|
const tsGlob = "**/*.{ts,cts,mts}";
|
|
36
|
-
/** Glob pattern for Vue linting */
|
|
37
34
|
const vueGlob = "**/*.vue";
|
|
38
|
-
/** Glob pattern for Markdown linting */
|
|
39
35
|
const mdGlob = "**/*.md";
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
36
|
+
const mdInMdGlob = "**/*.md/*.md";
|
|
37
|
+
const codeInMdGlob = "**/*.md/**/*.{js,cjs,mjs,ts,cts,mts,vue}";
|
|
38
|
+
const jsonGlob = "**/*.json";
|
|
39
|
+
const json5Glob = "**/*.json5";
|
|
40
|
+
const jsoncGlob = "**/*.jsonc";
|
|
41
|
+
const tsConfigGlob = ["**/tsconfig.json", "**/tsconfig.*.json"];
|
|
42
|
+
const packageJsonGlob = "**/package.json";
|
|
44
43
|
const ignoresGlob = [
|
|
45
44
|
"**/node_modules/**",
|
|
46
45
|
"**/dist/**",
|
|
@@ -107,6 +106,9 @@ function resolveOptions(value, defaults) {
|
|
|
107
106
|
if (!value) return false;
|
|
108
107
|
return (0, defu.defu)(value === true ? {} : value, defaults);
|
|
109
108
|
}
|
|
109
|
+
function extractRules(...configArrays) {
|
|
110
|
+
return Object.assign({}, ...configArrays.flat().map((config) => config?.rules || {}));
|
|
111
|
+
}
|
|
110
112
|
//#endregion
|
|
111
113
|
//#region src/configs/vue.ts
|
|
112
114
|
const sfcBlocksDefaults = { blocks: {
|
|
@@ -126,32 +128,31 @@ async function vue(options) {
|
|
|
126
128
|
importModule(import("vue-eslint-parser")),
|
|
127
129
|
importModule(import("typescript-eslint"))
|
|
128
130
|
]);
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
...vuePlugin.configs["flat/strongly-recommended"],
|
|
132
|
-
...vuePlugin.configs["flat/recommended"]
|
|
133
|
-
].map((config) => config?.rules || {}));
|
|
131
|
+
const baseRules = extractRules(vuePlugin.configs["flat/essential"], vuePlugin.configs["flat/strongly-recommended"], vuePlugin.configs["flat/recommended"]);
|
|
132
|
+
const processor = sfcBlocks === false ? vuePlugin.processors[".vue"] : (0, eslint_merge_processors.mergeProcessors)([vuePlugin.processors[".vue"], (0, eslint_processor_vue_blocks.default)(sfcBlocks)]);
|
|
134
133
|
return [{
|
|
135
|
-
name: "favorodera/vue",
|
|
134
|
+
name: "favorodera/vue/setup",
|
|
136
135
|
plugins: { vue: vuePlugin },
|
|
136
|
+
languageOptions: { globals: {
|
|
137
|
+
computed: "readonly",
|
|
138
|
+
defineEmits: "readonly",
|
|
139
|
+
defineExpose: "readonly",
|
|
140
|
+
defineProps: "readonly",
|
|
141
|
+
onMounted: "readonly",
|
|
142
|
+
onUnmounted: "readonly",
|
|
143
|
+
reactive: "readonly",
|
|
144
|
+
ref: "readonly",
|
|
145
|
+
shallowReactive: "readonly",
|
|
146
|
+
shallowRef: "readonly",
|
|
147
|
+
toRef: "readonly",
|
|
148
|
+
toRefs: "readonly",
|
|
149
|
+
watch: "readonly",
|
|
150
|
+
watchEffect: "readonly"
|
|
151
|
+
} }
|
|
152
|
+
}, {
|
|
153
|
+
name: "favorodera/vue/rules",
|
|
137
154
|
files: resolved.files,
|
|
138
155
|
languageOptions: {
|
|
139
|
-
globals: {
|
|
140
|
-
computed: "readonly",
|
|
141
|
-
defineEmits: "readonly",
|
|
142
|
-
defineExpose: "readonly",
|
|
143
|
-
defineProps: "readonly",
|
|
144
|
-
onMounted: "readonly",
|
|
145
|
-
onUnmounted: "readonly",
|
|
146
|
-
reactive: "readonly",
|
|
147
|
-
ref: "readonly",
|
|
148
|
-
shallowReactive: "readonly",
|
|
149
|
-
shallowRef: "readonly",
|
|
150
|
-
toRef: "readonly",
|
|
151
|
-
toRefs: "readonly",
|
|
152
|
-
watch: "readonly",
|
|
153
|
-
watchEffect: "readonly"
|
|
154
|
-
},
|
|
155
156
|
parser: vueParser,
|
|
156
157
|
parserOptions: {
|
|
157
158
|
parser: tsEsLint.parser,
|
|
@@ -159,9 +160,9 @@ async function vue(options) {
|
|
|
159
160
|
sourceType: "module"
|
|
160
161
|
}
|
|
161
162
|
},
|
|
162
|
-
processor
|
|
163
|
+
processor,
|
|
163
164
|
rules: {
|
|
164
|
-
...
|
|
165
|
+
...baseRules,
|
|
165
166
|
"vue/block-order": ["error", { order: [
|
|
166
167
|
"script",
|
|
167
168
|
"template",
|
|
@@ -206,16 +207,18 @@ const importsDefaults = { files: [
|
|
|
206
207
|
async function imports(options) {
|
|
207
208
|
const resolved = (0, defu.defu)(options, importsDefaults);
|
|
208
209
|
const [importPlugin, unusedImportsPlugin] = await Promise.all([importModule(import("eslint-plugin-import-lite")), importModule(import("eslint-plugin-unused-imports"))]);
|
|
209
|
-
const
|
|
210
|
+
const baseRules = importPlugin.configs.recommended?.rules || {};
|
|
210
211
|
return [{
|
|
211
|
-
name: "favorodera/imports",
|
|
212
|
-
files: resolved.files,
|
|
212
|
+
name: "favorodera/imports/setup",
|
|
213
213
|
plugins: {
|
|
214
214
|
"import": importPlugin,
|
|
215
215
|
"unused-imports": unusedImportsPlugin
|
|
216
|
-
}
|
|
216
|
+
}
|
|
217
|
+
}, {
|
|
218
|
+
name: "favorodera/imports/rules",
|
|
219
|
+
files: resolved.files,
|
|
217
220
|
rules: {
|
|
218
|
-
...(0, eslint_flat_config_utils.renamePluginsInRules)(
|
|
221
|
+
...(0, eslint_flat_config_utils.renamePluginsInRules)(baseRules, { "import-lite": "import" }),
|
|
219
222
|
"import/consistent-type-specifier-style": ["error", "top-level"],
|
|
220
223
|
"import/first": "error",
|
|
221
224
|
"import/no-duplicates": "error",
|
|
@@ -248,10 +251,9 @@ const javascriptDefaults = { files: [
|
|
|
248
251
|
*/
|
|
249
252
|
async function javascript(options) {
|
|
250
253
|
const resolved = (0, defu.defu)(options, javascriptDefaults);
|
|
251
|
-
const
|
|
254
|
+
const baseRules = (await importModule(import("@eslint/js"))).configs.recommended.rules;
|
|
252
255
|
return [{
|
|
253
|
-
name: "favorodera/javascript",
|
|
254
|
-
files: resolved.files,
|
|
256
|
+
name: "favorodera/javascript/setup",
|
|
255
257
|
languageOptions: {
|
|
256
258
|
ecmaVersion: "latest",
|
|
257
259
|
sourceType: "module",
|
|
@@ -264,9 +266,12 @@ async function javascript(options) {
|
|
|
264
266
|
window: "readonly"
|
|
265
267
|
}
|
|
266
268
|
},
|
|
267
|
-
linterOptions: { reportUnusedDisableDirectives: true }
|
|
269
|
+
linterOptions: { reportUnusedDisableDirectives: true }
|
|
270
|
+
}, {
|
|
271
|
+
name: "favorodera/javascript/rules",
|
|
272
|
+
files: resolved.files,
|
|
268
273
|
rules: {
|
|
269
|
-
...
|
|
274
|
+
...baseRules,
|
|
270
275
|
"accessor-pairs": ["error", {
|
|
271
276
|
enforceForClassMembers: true,
|
|
272
277
|
setWithoutGet: true
|
|
@@ -286,20 +291,57 @@ const markdownDefaults = {
|
|
|
286
291
|
async function markdown(options) {
|
|
287
292
|
const resolved = (0, defu.defu)(options, markdownDefaults);
|
|
288
293
|
const markdownPlugin = await importModule(import("@eslint/markdown"));
|
|
289
|
-
const
|
|
290
|
-
return [
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
"md/
|
|
299
|
-
|
|
300
|
-
|
|
294
|
+
const baseRules = extractRules(markdownPlugin.configs.recommended);
|
|
295
|
+
return [
|
|
296
|
+
{
|
|
297
|
+
name: "favorodera/markdown/setup",
|
|
298
|
+
plugins: { md: markdownPlugin }
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
name: "favorodera/markdown/rules",
|
|
302
|
+
files: resolved.files,
|
|
303
|
+
language: resolved.gfm ? "md/gfm" : "md/commonmark",
|
|
304
|
+
ignores: [mdInMdGlob],
|
|
305
|
+
processor: (0, eslint_merge_processors.mergeProcessors)([markdownPlugin.processors?.markdown, eslint_merge_processors.processorPassThrough]),
|
|
306
|
+
rules: {
|
|
307
|
+
...(0, eslint_flat_config_utils.renamePluginsInRules)(baseRules, { markdown: "md" }),
|
|
308
|
+
"md/fenced-code-language": "off",
|
|
309
|
+
"md/no-missing-label-refs": "off",
|
|
310
|
+
...resolved.overrides
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
name: "favorodera/markdown/disables/code",
|
|
315
|
+
files: [codeInMdGlob],
|
|
316
|
+
languageOptions: { parserOptions: { ecmaFeatures: { impliedStrict: true } } },
|
|
317
|
+
rules: {
|
|
318
|
+
"no-alert": "off",
|
|
319
|
+
"no-console": "off",
|
|
320
|
+
"no-labels": "off",
|
|
321
|
+
"no-lone-blocks": "off",
|
|
322
|
+
"no-restricted-syntax": "off",
|
|
323
|
+
"no-undef": "off",
|
|
324
|
+
"no-unused-expressions": "off",
|
|
325
|
+
"no-unused-labels": "off",
|
|
326
|
+
"no-unused-vars": "off",
|
|
327
|
+
"node/prefer-global/process": "off",
|
|
328
|
+
"style/comma-dangle": "off",
|
|
329
|
+
"style/eol-last": "off",
|
|
330
|
+
"style/padding-line-between-statements": "off",
|
|
331
|
+
"ts/consistent-type-imports": "off",
|
|
332
|
+
"ts/explicit-function-return-type": "off",
|
|
333
|
+
"ts/no-namespace": "off",
|
|
334
|
+
"ts/no-redeclare": "off",
|
|
335
|
+
"ts/no-require-imports": "off",
|
|
336
|
+
"ts/no-unused-expressions": "off",
|
|
337
|
+
"ts/no-unused-vars": "off",
|
|
338
|
+
"ts/no-use-before-define": "off",
|
|
339
|
+
"unicode-bom": "off",
|
|
340
|
+
"unused-imports/no-unused-imports": "off",
|
|
341
|
+
"unused-imports/no-unused-vars": "off"
|
|
342
|
+
}
|
|
301
343
|
}
|
|
302
|
-
|
|
344
|
+
];
|
|
303
345
|
}
|
|
304
346
|
//#endregion
|
|
305
347
|
//#region src/configs/stylistic.ts
|
|
@@ -319,17 +361,19 @@ const stylisticDefaults = {
|
|
|
319
361
|
};
|
|
320
362
|
async function stylistic(options) {
|
|
321
363
|
const resolved = (0, defu.defu)(options, stylisticDefaults);
|
|
322
|
-
const
|
|
364
|
+
const stylePlugin = await importModule(import("@stylistic/eslint-plugin"));
|
|
365
|
+
const baseRules = stylePlugin.configs.customize({
|
|
323
366
|
pluginName: "style",
|
|
324
367
|
...resolved.settings
|
|
325
|
-
});
|
|
326
|
-
const inheritedRules = config?.rules || {};
|
|
368
|
+
})?.rules || {};
|
|
327
369
|
return [{
|
|
328
|
-
|
|
329
|
-
|
|
370
|
+
name: "favorodera/stylistic/setup",
|
|
371
|
+
plugins: { style: stylePlugin }
|
|
372
|
+
}, {
|
|
373
|
+
name: "favorodera/stylistic/rules",
|
|
330
374
|
files: resolved.files,
|
|
331
375
|
rules: {
|
|
332
|
-
...
|
|
376
|
+
...baseRules,
|
|
333
377
|
"style/quotes": [
|
|
334
378
|
"error",
|
|
335
379
|
"single",
|
|
@@ -373,17 +417,19 @@ const tailwindDefaults = {
|
|
|
373
417
|
async function tailwind(options) {
|
|
374
418
|
const resolved = (0, defu.defu)(options, tailwindDefaults);
|
|
375
419
|
const tailwindPlugin = await importModule(import("eslint-plugin-better-tailwindcss"));
|
|
376
|
-
const
|
|
420
|
+
const baseRules = {
|
|
377
421
|
...tailwindPlugin.configs["recommended-error"].rules,
|
|
378
422
|
...tailwindPlugin.configs["stylistic-error"].rules
|
|
379
423
|
};
|
|
380
424
|
return [{
|
|
381
|
-
name: "favorodera/tailwind",
|
|
382
|
-
files: resolved.files,
|
|
425
|
+
name: "favorodera/tailwind/setup",
|
|
383
426
|
plugins: { tailwind: tailwindPlugin },
|
|
384
|
-
settings: { tailwindcss: resolved.settings }
|
|
427
|
+
settings: { tailwindcss: resolved.settings }
|
|
428
|
+
}, {
|
|
429
|
+
name: "favorodera/tailwind/rules",
|
|
430
|
+
files: resolved.files,
|
|
385
431
|
rules: {
|
|
386
|
-
...(0, eslint_flat_config_utils.renamePluginsInRules)(
|
|
432
|
+
...(0, eslint_flat_config_utils.renamePluginsInRules)(baseRules, { "better-tailwindcss": "tailwind" }),
|
|
387
433
|
"tailwind/no-unregistered-classes": "off",
|
|
388
434
|
"tailwind/enforce-consistent-line-wrapping": ["error", { group: "emptyLine" }],
|
|
389
435
|
...resolved.overrides
|
|
@@ -401,25 +447,313 @@ const typescriptDefaults = { files: [tsGlob] };
|
|
|
401
447
|
async function typescript(options) {
|
|
402
448
|
const resolved = (0, defu.defu)(options, typescriptDefaults);
|
|
403
449
|
const tsEsLint = await importModule(import("typescript-eslint"));
|
|
404
|
-
const
|
|
450
|
+
const baseRules = extractRules(tsEsLint.configs.recommended, tsEsLint.configs.strict);
|
|
405
451
|
return [{
|
|
406
|
-
name: "favorodera/typescript",
|
|
407
|
-
plugins: { ts: tsEsLint.plugin }
|
|
452
|
+
name: "favorodera/typescript/setup",
|
|
453
|
+
plugins: { ts: tsEsLint.plugin }
|
|
454
|
+
}, {
|
|
455
|
+
name: "favorodera/typescript/rules",
|
|
456
|
+
files: resolved.files,
|
|
408
457
|
languageOptions: {
|
|
409
458
|
parser: tsEsLint.parser,
|
|
410
459
|
parserOptions: { sourceType: "module" }
|
|
411
460
|
},
|
|
412
|
-
files: resolved.files,
|
|
413
461
|
rules: {
|
|
414
|
-
...(0, eslint_flat_config_utils.renamePluginsInRules)(
|
|
462
|
+
...(0, eslint_flat_config_utils.renamePluginsInRules)(baseRules, { "@typescript-eslint": "ts" }),
|
|
415
463
|
"ts/consistent-type-imports": ["error", { prefer: "type-imports" }],
|
|
416
464
|
"ts/no-empty-object-type": ["error", { allowInterfaces: "with-single-extends" }],
|
|
417
|
-
"ts/array-type": ["error", {
|
|
465
|
+
"ts/array-type": ["error", {
|
|
466
|
+
default: "generic",
|
|
467
|
+
readonly: "generic"
|
|
468
|
+
}],
|
|
418
469
|
...resolved.overrides
|
|
419
470
|
}
|
|
420
471
|
}];
|
|
421
472
|
}
|
|
422
473
|
//#endregion
|
|
474
|
+
//#region src/configs/jsonc.ts
|
|
475
|
+
const jsoncDefaults = { files: [
|
|
476
|
+
json5Glob,
|
|
477
|
+
jsoncGlob,
|
|
478
|
+
jsonGlob
|
|
479
|
+
] };
|
|
480
|
+
async function jsonc(options) {
|
|
481
|
+
const resolved = (0, defu.defu)(options, jsoncDefaults);
|
|
482
|
+
return [
|
|
483
|
+
{
|
|
484
|
+
name: "favorodera/jsonc/setup",
|
|
485
|
+
plugins: { jsonc: await importModule(import("eslint-plugin-jsonc")) }
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
name: "favorodera/jsonc/rules",
|
|
489
|
+
files: resolved.files,
|
|
490
|
+
language: "jsonc/x",
|
|
491
|
+
rules: {
|
|
492
|
+
"jsonc/no-bigint-literals": "error",
|
|
493
|
+
"jsonc/no-binary-expression": "error",
|
|
494
|
+
"jsonc/no-binary-numeric-literals": "error",
|
|
495
|
+
"jsonc/no-dupe-keys": "error",
|
|
496
|
+
"jsonc/no-escape-sequence-in-identifier": "error",
|
|
497
|
+
"jsonc/no-floating-decimal": "error",
|
|
498
|
+
"jsonc/no-hexadecimal-numeric-literals": "error",
|
|
499
|
+
"jsonc/no-infinity": "error",
|
|
500
|
+
"jsonc/no-multi-str": "error",
|
|
501
|
+
"jsonc/no-nan": "error",
|
|
502
|
+
"jsonc/no-number-props": "error",
|
|
503
|
+
"jsonc/no-numeric-separators": "error",
|
|
504
|
+
"jsonc/no-octal": "error",
|
|
505
|
+
"jsonc/no-octal-escape": "error",
|
|
506
|
+
"jsonc/no-octal-numeric-literals": "error",
|
|
507
|
+
"jsonc/no-parenthesized": "error",
|
|
508
|
+
"jsonc/no-plus-sign": "error",
|
|
509
|
+
"jsonc/no-regexp-literals": "error",
|
|
510
|
+
"jsonc/no-sparse-arrays": "error",
|
|
511
|
+
"jsonc/no-template-literals": "error",
|
|
512
|
+
"jsonc/no-undefined-value": "error",
|
|
513
|
+
"jsonc/no-unicode-codepoint-escapes": "error",
|
|
514
|
+
"jsonc/no-useless-escape": "error",
|
|
515
|
+
"jsonc/space-unary-ops": "error",
|
|
516
|
+
"jsonc/valid-json-number": "error",
|
|
517
|
+
"jsonc/vue-custom-block/no-parsing-error": "error",
|
|
518
|
+
"jsonc/array-bracket-spacing": ["error", "never"],
|
|
519
|
+
"jsonc/comma-dangle": ["error", "never"],
|
|
520
|
+
"jsonc/comma-style": ["error", "last"],
|
|
521
|
+
"jsonc/indent": ["error", 2],
|
|
522
|
+
"jsonc/key-spacing": ["error", {
|
|
523
|
+
afterColon: true,
|
|
524
|
+
beforeColon: false
|
|
525
|
+
}],
|
|
526
|
+
"jsonc/object-curly-newline": ["error", {
|
|
527
|
+
consistent: true,
|
|
528
|
+
multiline: true
|
|
529
|
+
}],
|
|
530
|
+
"jsonc/object-curly-spacing": ["error", "always"],
|
|
531
|
+
"jsonc/object-property-newline": ["error", { allowAllPropertiesOnSameLine: true }],
|
|
532
|
+
"jsonc/quote-props": "error",
|
|
533
|
+
"jsonc/quotes": "error",
|
|
534
|
+
...resolved.overrides
|
|
535
|
+
}
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
name: "favorodera/jsonc/sort/package-json",
|
|
539
|
+
files: [packageJsonGlob],
|
|
540
|
+
rules: {
|
|
541
|
+
"jsonc/sort-array-values": ["error", {
|
|
542
|
+
order: { type: "asc" },
|
|
543
|
+
pathPattern: "^files$"
|
|
544
|
+
}],
|
|
545
|
+
"jsonc/sort-keys": [
|
|
546
|
+
"error",
|
|
547
|
+
{
|
|
548
|
+
order: [
|
|
549
|
+
"publisher",
|
|
550
|
+
"name",
|
|
551
|
+
"displayName",
|
|
552
|
+
"type",
|
|
553
|
+
"version",
|
|
554
|
+
"private",
|
|
555
|
+
"packageManager",
|
|
556
|
+
"description",
|
|
557
|
+
"author",
|
|
558
|
+
"contributors",
|
|
559
|
+
"license",
|
|
560
|
+
"funding",
|
|
561
|
+
"homepage",
|
|
562
|
+
"repository",
|
|
563
|
+
"bugs",
|
|
564
|
+
"keywords",
|
|
565
|
+
"categories",
|
|
566
|
+
"sideEffects",
|
|
567
|
+
"imports",
|
|
568
|
+
"exports",
|
|
569
|
+
"main",
|
|
570
|
+
"module",
|
|
571
|
+
"unpkg",
|
|
572
|
+
"jsdelivr",
|
|
573
|
+
"types",
|
|
574
|
+
"typesVersions",
|
|
575
|
+
"bin",
|
|
576
|
+
"icon",
|
|
577
|
+
"files",
|
|
578
|
+
"engines",
|
|
579
|
+
"activationEvents",
|
|
580
|
+
"contributes",
|
|
581
|
+
"scripts",
|
|
582
|
+
"peerDependencies",
|
|
583
|
+
"peerDependenciesMeta",
|
|
584
|
+
"dependencies",
|
|
585
|
+
"optionalDependencies",
|
|
586
|
+
"devDependencies",
|
|
587
|
+
"pnpm",
|
|
588
|
+
"overrides",
|
|
589
|
+
"resolutions",
|
|
590
|
+
"husky",
|
|
591
|
+
"simple-git-hooks",
|
|
592
|
+
"lint-staged",
|
|
593
|
+
"eslintConfig"
|
|
594
|
+
],
|
|
595
|
+
pathPattern: "^$"
|
|
596
|
+
},
|
|
597
|
+
{
|
|
598
|
+
order: { type: "asc" },
|
|
599
|
+
pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$"
|
|
600
|
+
},
|
|
601
|
+
{
|
|
602
|
+
order: { type: "asc" },
|
|
603
|
+
pathPattern: "^(?:resolutions|overrides|pnpm.overrides)$"
|
|
604
|
+
},
|
|
605
|
+
{
|
|
606
|
+
order: { type: "asc" },
|
|
607
|
+
pathPattern: "^workspaces\\.catalog$"
|
|
608
|
+
},
|
|
609
|
+
{
|
|
610
|
+
order: { type: "asc" },
|
|
611
|
+
pathPattern: "^workspaces\\.catalogs\\.[^.]+$"
|
|
612
|
+
},
|
|
613
|
+
{
|
|
614
|
+
order: [
|
|
615
|
+
"types",
|
|
616
|
+
"import",
|
|
617
|
+
"require",
|
|
618
|
+
"default"
|
|
619
|
+
],
|
|
620
|
+
pathPattern: "^exports.*$"
|
|
621
|
+
},
|
|
622
|
+
{
|
|
623
|
+
order: [
|
|
624
|
+
"pre-commit",
|
|
625
|
+
"prepare-commit-msg",
|
|
626
|
+
"commit-msg",
|
|
627
|
+
"post-commit",
|
|
628
|
+
"pre-rebase",
|
|
629
|
+
"post-rewrite",
|
|
630
|
+
"post-checkout",
|
|
631
|
+
"post-merge",
|
|
632
|
+
"pre-push",
|
|
633
|
+
"pre-auto-gc"
|
|
634
|
+
],
|
|
635
|
+
pathPattern: "^(?:gitHooks|husky|simple-git-hooks)$"
|
|
636
|
+
}
|
|
637
|
+
]
|
|
638
|
+
}
|
|
639
|
+
},
|
|
640
|
+
{
|
|
641
|
+
name: "favorodera/jsonc/sort/tsconfig-json",
|
|
642
|
+
files: tsConfigGlob,
|
|
643
|
+
rules: { "jsonc/sort-keys": [
|
|
644
|
+
"error",
|
|
645
|
+
{
|
|
646
|
+
order: [
|
|
647
|
+
"extends",
|
|
648
|
+
"compilerOptions",
|
|
649
|
+
"references",
|
|
650
|
+
"files",
|
|
651
|
+
"include",
|
|
652
|
+
"exclude"
|
|
653
|
+
],
|
|
654
|
+
pathPattern: "^$"
|
|
655
|
+
},
|
|
656
|
+
{
|
|
657
|
+
order: [
|
|
658
|
+
"incremental",
|
|
659
|
+
"composite",
|
|
660
|
+
"tsBuildInfoFile",
|
|
661
|
+
"disableSourceOfProjectReferenceRedirect",
|
|
662
|
+
"disableSolutionSearching",
|
|
663
|
+
"disableReferencedProjectLoad",
|
|
664
|
+
"target",
|
|
665
|
+
"jsx",
|
|
666
|
+
"jsxFactory",
|
|
667
|
+
"jsxFragmentFactory",
|
|
668
|
+
"jsxImportSource",
|
|
669
|
+
"lib",
|
|
670
|
+
"moduleDetection",
|
|
671
|
+
"noLib",
|
|
672
|
+
"reactNamespace",
|
|
673
|
+
"useDefineForClassFields",
|
|
674
|
+
"emitDecoratorMetadata",
|
|
675
|
+
"experimentalDecorators",
|
|
676
|
+
"libReplacement",
|
|
677
|
+
"baseUrl",
|
|
678
|
+
"rootDir",
|
|
679
|
+
"rootDirs",
|
|
680
|
+
"customConditions",
|
|
681
|
+
"module",
|
|
682
|
+
"moduleResolution",
|
|
683
|
+
"moduleSuffixes",
|
|
684
|
+
"noResolve",
|
|
685
|
+
"paths",
|
|
686
|
+
"resolveJsonModule",
|
|
687
|
+
"resolvePackageJsonExports",
|
|
688
|
+
"resolvePackageJsonImports",
|
|
689
|
+
"typeRoots",
|
|
690
|
+
"types",
|
|
691
|
+
"allowArbitraryExtensions",
|
|
692
|
+
"allowImportingTsExtensions",
|
|
693
|
+
"allowUmdGlobalAccess",
|
|
694
|
+
"allowJs",
|
|
695
|
+
"checkJs",
|
|
696
|
+
"maxNodeModuleJsDepth",
|
|
697
|
+
"strict",
|
|
698
|
+
"strictBindCallApply",
|
|
699
|
+
"strictFunctionTypes",
|
|
700
|
+
"strictNullChecks",
|
|
701
|
+
"strictPropertyInitialization",
|
|
702
|
+
"allowUnreachableCode",
|
|
703
|
+
"allowUnusedLabels",
|
|
704
|
+
"alwaysStrict",
|
|
705
|
+
"exactOptionalPropertyTypes",
|
|
706
|
+
"noFallthroughCasesInSwitch",
|
|
707
|
+
"noImplicitAny",
|
|
708
|
+
"noImplicitOverride",
|
|
709
|
+
"noImplicitReturns",
|
|
710
|
+
"noImplicitThis",
|
|
711
|
+
"noPropertyAccessFromIndexSignature",
|
|
712
|
+
"noUncheckedIndexedAccess",
|
|
713
|
+
"noUnusedLocals",
|
|
714
|
+
"noUnusedParameters",
|
|
715
|
+
"useUnknownInCatchVariables",
|
|
716
|
+
"declaration",
|
|
717
|
+
"declarationDir",
|
|
718
|
+
"declarationMap",
|
|
719
|
+
"downlevelIteration",
|
|
720
|
+
"emitBOM",
|
|
721
|
+
"emitDeclarationOnly",
|
|
722
|
+
"importHelpers",
|
|
723
|
+
"importsNotUsedAsValues",
|
|
724
|
+
"inlineSourceMap",
|
|
725
|
+
"inlineSources",
|
|
726
|
+
"mapRoot",
|
|
727
|
+
"newLine",
|
|
728
|
+
"noEmit",
|
|
729
|
+
"noEmitHelpers",
|
|
730
|
+
"noEmitOnError",
|
|
731
|
+
"outDir",
|
|
732
|
+
"outFile",
|
|
733
|
+
"preserveConstEnums",
|
|
734
|
+
"preserveValueImports",
|
|
735
|
+
"removeComments",
|
|
736
|
+
"sourceMap",
|
|
737
|
+
"sourceRoot",
|
|
738
|
+
"stripInternal",
|
|
739
|
+
"allowSyntheticDefaultImports",
|
|
740
|
+
"esModuleInterop",
|
|
741
|
+
"forceConsistentCasingInFileNames",
|
|
742
|
+
"isolatedDeclarations",
|
|
743
|
+
"isolatedModules",
|
|
744
|
+
"preserveSymlinks",
|
|
745
|
+
"verbatimModuleSyntax",
|
|
746
|
+
"erasableSyntaxOnly",
|
|
747
|
+
"skipDefaultLibCheck",
|
|
748
|
+
"skipLibCheck"
|
|
749
|
+
],
|
|
750
|
+
pathPattern: "^compilerOptions$"
|
|
751
|
+
}
|
|
752
|
+
] }
|
|
753
|
+
}
|
|
754
|
+
];
|
|
755
|
+
}
|
|
756
|
+
//#endregion
|
|
423
757
|
//#region src/factory.ts
|
|
424
758
|
/**
|
|
425
759
|
* Factory to create a flat ESLint config
|
|
@@ -436,7 +770,8 @@ function factory(options = {}) {
|
|
|
436
770
|
tailwind,
|
|
437
771
|
imports,
|
|
438
772
|
markdown,
|
|
439
|
-
javascript
|
|
773
|
+
javascript,
|
|
774
|
+
jsonc
|
|
440
775
|
};
|
|
441
776
|
for (const [key, configFunction] of Object.entries(configFunctions)) {
|
|
442
777
|
const configOption = options[key];
|