@lincy/eslint-config 5.2.5 → 5.2.7
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 +72 -31
- package/dist/index.d.cts +683 -360
- package/dist/index.d.ts +683 -360
- package/dist/index.js +71 -30
- package/package.json +37 -37
package/dist/index.cjs
CHANGED
|
@@ -99,7 +99,7 @@ __export(src_exports, {
|
|
|
99
99
|
});
|
|
100
100
|
module.exports = __toCommonJS(src_exports);
|
|
101
101
|
|
|
102
|
-
// node_modules/.pnpm/tsup@8.3.
|
|
102
|
+
// node_modules/.pnpm/tsup@8.3.5_jiti@2.3.3_postcss@8.4.47_tsx@4.19.2_typescript@5.6.3_yaml@2.6.0/node_modules/tsup/assets/cjs_shims.js
|
|
103
103
|
var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
|
|
104
104
|
var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
105
105
|
|
|
@@ -249,13 +249,6 @@ async function disables() {
|
|
|
249
249
|
"unused-imports/no-unused-vars": "off"
|
|
250
250
|
}
|
|
251
251
|
},
|
|
252
|
-
{
|
|
253
|
-
files: ["**/*.{test,spec}.([tj])s?(x)"],
|
|
254
|
-
name: "eslint/disables/test",
|
|
255
|
-
rules: {
|
|
256
|
-
"no-unused-expressions": "off"
|
|
257
|
-
}
|
|
258
|
-
},
|
|
259
252
|
{
|
|
260
253
|
files: ["**/*.js", "**/*.cjs"],
|
|
261
254
|
name: "eslint/disables/cjs",
|
|
@@ -428,10 +421,20 @@ async function stylistic(options = {}) {
|
|
|
428
421
|
}
|
|
429
422
|
|
|
430
423
|
// src/configs/formatters.ts
|
|
424
|
+
function mergePrettierOptions(options, overrides = {}) {
|
|
425
|
+
return {
|
|
426
|
+
...options,
|
|
427
|
+
...overrides,
|
|
428
|
+
plugins: [
|
|
429
|
+
...overrides.plugins || [],
|
|
430
|
+
...options.plugins || []
|
|
431
|
+
]
|
|
432
|
+
};
|
|
433
|
+
}
|
|
431
434
|
async function formatters(options = {}, stylistic2 = {}) {
|
|
432
435
|
const defaultIndent = 4;
|
|
436
|
+
const isPrettierPluginXmlInScope = isPackageInScope("@prettier/plugin-xml");
|
|
433
437
|
if (options === true) {
|
|
434
|
-
const isPrettierPluginXmlInScope = isPackageInScope("@prettier/plugin-xml");
|
|
435
438
|
options = {
|
|
436
439
|
css: false,
|
|
437
440
|
graphql: true,
|
|
@@ -440,6 +443,15 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
440
443
|
svg: isPrettierPluginXmlInScope,
|
|
441
444
|
xml: isPrettierPluginXmlInScope
|
|
442
445
|
};
|
|
446
|
+
} else {
|
|
447
|
+
options = {
|
|
448
|
+
css: options.css ?? false,
|
|
449
|
+
graphql: options.graphql ?? true,
|
|
450
|
+
html: options.html ?? true,
|
|
451
|
+
markdown: options.markdown ?? true,
|
|
452
|
+
svg: isPrettierPluginXmlInScope,
|
|
453
|
+
xml: isPrettierPluginXmlInScope
|
|
454
|
+
};
|
|
443
455
|
}
|
|
444
456
|
await ensurePackages([
|
|
445
457
|
"eslint-plugin-format",
|
|
@@ -499,10 +511,10 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
499
511
|
rules: {
|
|
500
512
|
"format/prettier": [
|
|
501
513
|
"error",
|
|
502
|
-
{
|
|
514
|
+
mergePrettierOptions(prettierOptions, {
|
|
503
515
|
...prettierOptions,
|
|
504
516
|
parser: "css"
|
|
505
|
-
}
|
|
517
|
+
})
|
|
506
518
|
]
|
|
507
519
|
}
|
|
508
520
|
},
|
|
@@ -515,10 +527,10 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
515
527
|
rules: {
|
|
516
528
|
"format/prettier": [
|
|
517
529
|
"error",
|
|
518
|
-
{
|
|
530
|
+
mergePrettierOptions(prettierOptions, {
|
|
519
531
|
...prettierOptions,
|
|
520
532
|
parser: "scss"
|
|
521
|
-
}
|
|
533
|
+
})
|
|
522
534
|
]
|
|
523
535
|
}
|
|
524
536
|
},
|
|
@@ -531,10 +543,10 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
531
543
|
rules: {
|
|
532
544
|
"format/prettier": [
|
|
533
545
|
"error",
|
|
534
|
-
{
|
|
546
|
+
mergePrettierOptions(prettierOptions, {
|
|
535
547
|
...prettierOptions,
|
|
536
548
|
parser: "less"
|
|
537
|
-
}
|
|
549
|
+
})
|
|
538
550
|
]
|
|
539
551
|
}
|
|
540
552
|
}
|
|
@@ -550,10 +562,30 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
550
562
|
rules: {
|
|
551
563
|
"format/prettier": [
|
|
552
564
|
"error",
|
|
553
|
-
{
|
|
565
|
+
mergePrettierOptions(prettierOptions, {
|
|
554
566
|
...prettierOptions,
|
|
555
567
|
parser: "html"
|
|
556
|
-
}
|
|
568
|
+
})
|
|
569
|
+
]
|
|
570
|
+
}
|
|
571
|
+
});
|
|
572
|
+
}
|
|
573
|
+
if (options.xml) {
|
|
574
|
+
configs2.push({
|
|
575
|
+
files: [GLOB_XML],
|
|
576
|
+
languageOptions: {
|
|
577
|
+
parser: parserPlain
|
|
578
|
+
},
|
|
579
|
+
name: "eslint/formatter/xml",
|
|
580
|
+
rules: {
|
|
581
|
+
"format/prettier": [
|
|
582
|
+
"error",
|
|
583
|
+
mergePrettierOptions({ ...prettierXmlOptions, ...prettierOptions }, {
|
|
584
|
+
parser: "xml",
|
|
585
|
+
plugins: [
|
|
586
|
+
"@prettier/plugin-xml"
|
|
587
|
+
]
|
|
588
|
+
})
|
|
557
589
|
]
|
|
558
590
|
}
|
|
559
591
|
});
|
|
@@ -568,14 +600,12 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
568
600
|
rules: {
|
|
569
601
|
"format/prettier": [
|
|
570
602
|
"error",
|
|
571
|
-
{
|
|
572
|
-
...prettierXmlOptions,
|
|
573
|
-
...prettierOptions,
|
|
603
|
+
mergePrettierOptions({ ...prettierXmlOptions, ...prettierOptions }, {
|
|
574
604
|
parser: "xml",
|
|
575
605
|
plugins: [
|
|
576
606
|
"@prettier/plugin-xml"
|
|
577
607
|
]
|
|
578
|
-
}
|
|
608
|
+
})
|
|
579
609
|
]
|
|
580
610
|
}
|
|
581
611
|
});
|
|
@@ -591,11 +621,10 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
591
621
|
rules: {
|
|
592
622
|
[`format/${formater}`]: [
|
|
593
623
|
"error",
|
|
594
|
-
formater === "prettier" ? {
|
|
595
|
-
...prettierOptions,
|
|
624
|
+
formater === "prettier" ? mergePrettierOptions(prettierOptions, {
|
|
596
625
|
embeddedLanguageFormatting: "off",
|
|
597
626
|
parser: "markdown"
|
|
598
|
-
} : {
|
|
627
|
+
}) : {
|
|
599
628
|
...dprintOptions,
|
|
600
629
|
language: "markdown"
|
|
601
630
|
}
|
|
@@ -613,10 +642,9 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
613
642
|
rules: {
|
|
614
643
|
"format/prettier": [
|
|
615
644
|
"error",
|
|
616
|
-
{
|
|
617
|
-
...prettierOptions,
|
|
645
|
+
mergePrettierOptions(prettierOptions, {
|
|
618
646
|
parser: "graphql"
|
|
619
|
-
}
|
|
647
|
+
})
|
|
620
648
|
]
|
|
621
649
|
}
|
|
622
650
|
});
|
|
@@ -1053,6 +1081,7 @@ async function markdown(options = {}) {
|
|
|
1053
1081
|
},
|
|
1054
1082
|
name: "eslint/markdown/disables",
|
|
1055
1083
|
rules: {
|
|
1084
|
+
"antfu/no-top-level-await": "off",
|
|
1056
1085
|
"import/newline-after-import": "off",
|
|
1057
1086
|
"no-alert": "off",
|
|
1058
1087
|
"no-console": "off",
|
|
@@ -1586,14 +1615,19 @@ async function test(options = {}) {
|
|
|
1586
1615
|
files,
|
|
1587
1616
|
name: "eslint/test/rules",
|
|
1588
1617
|
rules: {
|
|
1589
|
-
"node/prefer-global/process": "off",
|
|
1590
1618
|
"test/consistent-test-it": ["error", { fn: "it", withinDescribe: "it" }],
|
|
1591
1619
|
"test/no-identical-title": "error",
|
|
1592
1620
|
"test/no-import-node-test": "error",
|
|
1593
1621
|
"test/no-only-tests": isInEditor ? "off" : "error",
|
|
1594
1622
|
"test/prefer-hooks-in-order": "error",
|
|
1595
1623
|
"test/prefer-lowercase-title": "error",
|
|
1596
|
-
|
|
1624
|
+
// Disables
|
|
1625
|
+
...{
|
|
1626
|
+
"antfu/no-top-level-await": "off",
|
|
1627
|
+
"no-unused-expressions": "off",
|
|
1628
|
+
"node/prefer-global/process": "off",
|
|
1629
|
+
"ts/explicit-function-return-type": "off"
|
|
1630
|
+
},
|
|
1597
1631
|
...overrides
|
|
1598
1632
|
}
|
|
1599
1633
|
}
|
|
@@ -1917,7 +1951,6 @@ async function vue(options = {}) {
|
|
|
1917
1951
|
parserVue,
|
|
1918
1952
|
processorVueBlocks
|
|
1919
1953
|
] = await Promise.all([
|
|
1920
|
-
// @ts-expect-error missing types
|
|
1921
1954
|
interopDefault(import("eslint-plugin-vue")),
|
|
1922
1955
|
interopDefault(import("vue-eslint-parser")),
|
|
1923
1956
|
interopDefault(import("eslint-processor-vue-blocks"))
|
|
@@ -1994,6 +2027,7 @@ async function vue(options = {}) {
|
|
|
1994
2027
|
...vueVersion === "2" ? {
|
|
1995
2028
|
"vue/require-explicit-emits": "off"
|
|
1996
2029
|
} : null,
|
|
2030
|
+
"no-irregular-whitespace": "off",
|
|
1997
2031
|
"vue/define-macros-order": ["error", {
|
|
1998
2032
|
order: ["defineOptions", "defineProps", "defineEmits", "defineSlots"]
|
|
1999
2033
|
}],
|
|
@@ -2022,7 +2056,14 @@ async function vue(options = {}) {
|
|
|
2022
2056
|
"vue/no-dupe-keys": "off",
|
|
2023
2057
|
"vue/no-empty-pattern": "error",
|
|
2024
2058
|
"vue/no-extra-parens": ["error", "functions"],
|
|
2025
|
-
"vue/no-irregular-whitespace": "error",
|
|
2059
|
+
"vue/no-irregular-whitespace": ["error", {
|
|
2060
|
+
skipComments: false,
|
|
2061
|
+
skipHTMLAttributeValues: false,
|
|
2062
|
+
skipHTMLTextContents: true,
|
|
2063
|
+
skipRegExps: false,
|
|
2064
|
+
skipStrings: true,
|
|
2065
|
+
skipTemplates: false
|
|
2066
|
+
}],
|
|
2026
2067
|
"vue/no-loss-of-precision": "error",
|
|
2027
2068
|
"vue/no-restricted-syntax": [
|
|
2028
2069
|
"error",
|