@lincy/eslint-config 5.2.5 → 5.2.6

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 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.0_jiti@1.21.6_postcss@8.4.47_tsx@4.19.1_typescript@5.6.2_yaml@2.5.1/node_modules/tsup/assets/cjs_shims.js
102
+ // node_modules/.pnpm/tsup@8.3.0_jiti@2.3.3_postcss@8.4.47_tsx@4.19.1_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,6 +421,16 @@ 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;
433
436
  if (options === true) {
@@ -499,10 +502,10 @@ async function formatters(options = {}, stylistic2 = {}) {
499
502
  rules: {
500
503
  "format/prettier": [
501
504
  "error",
502
- {
505
+ mergePrettierOptions(prettierOptions, {
503
506
  ...prettierOptions,
504
507
  parser: "css"
505
- }
508
+ })
506
509
  ]
507
510
  }
508
511
  },
@@ -515,10 +518,10 @@ async function formatters(options = {}, stylistic2 = {}) {
515
518
  rules: {
516
519
  "format/prettier": [
517
520
  "error",
518
- {
521
+ mergePrettierOptions(prettierOptions, {
519
522
  ...prettierOptions,
520
523
  parser: "scss"
521
- }
524
+ })
522
525
  ]
523
526
  }
524
527
  },
@@ -531,10 +534,10 @@ async function formatters(options = {}, stylistic2 = {}) {
531
534
  rules: {
532
535
  "format/prettier": [
533
536
  "error",
534
- {
537
+ mergePrettierOptions(prettierOptions, {
535
538
  ...prettierOptions,
536
539
  parser: "less"
537
- }
540
+ })
538
541
  ]
539
542
  }
540
543
  }
@@ -550,10 +553,30 @@ async function formatters(options = {}, stylistic2 = {}) {
550
553
  rules: {
551
554
  "format/prettier": [
552
555
  "error",
553
- {
556
+ mergePrettierOptions(prettierOptions, {
554
557
  ...prettierOptions,
555
558
  parser: "html"
556
- }
559
+ })
560
+ ]
561
+ }
562
+ });
563
+ }
564
+ if (options.xml) {
565
+ configs2.push({
566
+ files: [GLOB_XML],
567
+ languageOptions: {
568
+ parser: parserPlain
569
+ },
570
+ name: "eslint/formatter/xml",
571
+ rules: {
572
+ "format/prettier": [
573
+ "error",
574
+ mergePrettierOptions({ ...prettierXmlOptions, ...prettierOptions }, {
575
+ parser: "xml",
576
+ plugins: [
577
+ "@prettier/plugin-xml"
578
+ ]
579
+ })
557
580
  ]
558
581
  }
559
582
  });
@@ -568,14 +591,12 @@ async function formatters(options = {}, stylistic2 = {}) {
568
591
  rules: {
569
592
  "format/prettier": [
570
593
  "error",
571
- {
572
- ...prettierXmlOptions,
573
- ...prettierOptions,
594
+ mergePrettierOptions({ ...prettierXmlOptions, ...prettierOptions }, {
574
595
  parser: "xml",
575
596
  plugins: [
576
597
  "@prettier/plugin-xml"
577
598
  ]
578
- }
599
+ })
579
600
  ]
580
601
  }
581
602
  });
@@ -591,11 +612,10 @@ async function formatters(options = {}, stylistic2 = {}) {
591
612
  rules: {
592
613
  [`format/${formater}`]: [
593
614
  "error",
594
- formater === "prettier" ? {
595
- ...prettierOptions,
615
+ formater === "prettier" ? mergePrettierOptions(prettierOptions, {
596
616
  embeddedLanguageFormatting: "off",
597
617
  parser: "markdown"
598
- } : {
618
+ }) : {
599
619
  ...dprintOptions,
600
620
  language: "markdown"
601
621
  }
@@ -613,10 +633,9 @@ async function formatters(options = {}, stylistic2 = {}) {
613
633
  rules: {
614
634
  "format/prettier": [
615
635
  "error",
616
- {
617
- ...prettierOptions,
636
+ mergePrettierOptions(prettierOptions, {
618
637
  parser: "graphql"
619
- }
638
+ })
620
639
  ]
621
640
  }
622
641
  });
@@ -1053,6 +1072,7 @@ async function markdown(options = {}) {
1053
1072
  },
1054
1073
  name: "eslint/markdown/disables",
1055
1074
  rules: {
1075
+ "antfu/no-top-level-await": "off",
1056
1076
  "import/newline-after-import": "off",
1057
1077
  "no-alert": "off",
1058
1078
  "no-console": "off",
@@ -1586,14 +1606,19 @@ async function test(options = {}) {
1586
1606
  files,
1587
1607
  name: "eslint/test/rules",
1588
1608
  rules: {
1589
- "node/prefer-global/process": "off",
1590
1609
  "test/consistent-test-it": ["error", { fn: "it", withinDescribe: "it" }],
1591
1610
  "test/no-identical-title": "error",
1592
1611
  "test/no-import-node-test": "error",
1593
1612
  "test/no-only-tests": isInEditor ? "off" : "error",
1594
1613
  "test/prefer-hooks-in-order": "error",
1595
1614
  "test/prefer-lowercase-title": "error",
1596
- "ts/explicit-function-return-type": "off",
1615
+ // Disables
1616
+ ...{
1617
+ "antfu/no-top-level-await": "off",
1618
+ "no-unused-expressions": "off",
1619
+ "node/prefer-global/process": "off",
1620
+ "ts/explicit-function-return-type": "off"
1621
+ },
1597
1622
  ...overrides
1598
1623
  }
1599
1624
  }
@@ -1917,7 +1942,6 @@ async function vue(options = {}) {
1917
1942
  parserVue,
1918
1943
  processorVueBlocks
1919
1944
  ] = await Promise.all([
1920
- // @ts-expect-error missing types
1921
1945
  interopDefault(import("eslint-plugin-vue")),
1922
1946
  interopDefault(import("vue-eslint-parser")),
1923
1947
  interopDefault(import("eslint-processor-vue-blocks"))
@@ -1994,6 +2018,7 @@ async function vue(options = {}) {
1994
2018
  ...vueVersion === "2" ? {
1995
2019
  "vue/require-explicit-emits": "off"
1996
2020
  } : null,
2021
+ "no-irregular-whitespace": "off",
1997
2022
  "vue/define-macros-order": ["error", {
1998
2023
  order: ["defineOptions", "defineProps", "defineEmits", "defineSlots"]
1999
2024
  }],
@@ -2022,7 +2047,14 @@ async function vue(options = {}) {
2022
2047
  "vue/no-dupe-keys": "off",
2023
2048
  "vue/no-empty-pattern": "error",
2024
2049
  "vue/no-extra-parens": ["error", "functions"],
2025
- "vue/no-irregular-whitespace": "error",
2050
+ "vue/no-irregular-whitespace": ["error", {
2051
+ skipComments: false,
2052
+ skipHTMLAttributeValues: false,
2053
+ skipHTMLTextContents: true,
2054
+ skipRegExps: false,
2055
+ skipStrings: true,
2056
+ skipTemplates: false
2057
+ }],
2026
2058
  "vue/no-loss-of-precision": "error",
2027
2059
  "vue/no-restricted-syntax": [
2028
2060
  "error",