@vinicunca/eslint-config 2.11.6 → 2.11.9

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
@@ -492,6 +492,16 @@ async function stylistic(options = {}) {
492
492
  }
493
493
 
494
494
  // src/configs/formatters.ts
495
+ function mergePrettierOptions(options, overrides = {}) {
496
+ return {
497
+ ...options,
498
+ ...overrides,
499
+ plugins: [
500
+ ...overrides.plugins || [],
501
+ ...options.plugins || []
502
+ ]
503
+ };
504
+ }
495
505
  async function formatters(options = {}, stylistic2 = {}) {
496
506
  if (options === true) {
497
507
  const isPrettierPluginXmlInScope = isPackageInScope("@prettier/plugin-xml");
@@ -567,10 +577,9 @@ async function formatters(options = {}, stylistic2 = {}) {
567
577
  rules: {
568
578
  "format/prettier": [
569
579
  ERROR,
570
- {
571
- ...prettierOptions,
580
+ mergePrettierOptions(prettierOptions, {
572
581
  parser: "css"
573
- }
582
+ })
574
583
  ]
575
584
  }
576
585
  },
@@ -583,10 +592,9 @@ async function formatters(options = {}, stylistic2 = {}) {
583
592
  rules: {
584
593
  "format/prettier": [
585
594
  ERROR,
586
- {
587
- ...prettierOptions,
595
+ mergePrettierOptions(prettierOptions, {
588
596
  parser: "scss"
589
- }
597
+ })
590
598
  ]
591
599
  }
592
600
  },
@@ -599,10 +607,9 @@ async function formatters(options = {}, stylistic2 = {}) {
599
607
  rules: {
600
608
  "format/prettier": [
601
609
  ERROR,
602
- {
603
- ...prettierOptions,
610
+ mergePrettierOptions(prettierOptions, {
604
611
  parser: "less"
605
- }
612
+ })
606
613
  ]
607
614
  }
608
615
  }
@@ -618,10 +625,9 @@ async function formatters(options = {}, stylistic2 = {}) {
618
625
  rules: {
619
626
  "format/prettier": [
620
627
  ERROR,
621
- {
622
- ...prettierOptions,
628
+ mergePrettierOptions(prettierOptions, {
623
629
  parser: "html"
624
- }
630
+ })
625
631
  ]
626
632
  }
627
633
  });
@@ -636,14 +642,12 @@ async function formatters(options = {}, stylistic2 = {}) {
636
642
  rules: {
637
643
  "format/prettier": [
638
644
  ERROR,
639
- {
640
- ...prettierXmlOptions,
641
- ...prettierOptions,
645
+ mergePrettierOptions({ ...prettierXmlOptions, ...prettierOptions }, {
642
646
  parser: "xml",
643
647
  plugins: [
644
648
  "@prettier/plugin-xml"
645
649
  ]
646
- }
650
+ })
647
651
  ]
648
652
  }
649
653
  });
@@ -658,14 +662,12 @@ async function formatters(options = {}, stylistic2 = {}) {
658
662
  rules: {
659
663
  "format/prettier": [
660
664
  ERROR,
661
- {
662
- ...prettierXmlOptions,
663
- ...prettierOptions,
665
+ mergePrettierOptions({ ...prettierXmlOptions, ...prettierOptions }, {
664
666
  parser: "xml",
665
667
  plugins: [
666
668
  "@prettier/plugin-xml"
667
669
  ]
668
- }
670
+ })
669
671
  ]
670
672
  }
671
673
  });
@@ -688,12 +690,10 @@ async function formatters(options = {}, stylistic2 = {}) {
688
690
  rules: {
689
691
  [`format/${formater}`]: [
690
692
  ERROR,
691
- formater === "prettier" ? {
692
- printWidth: 120,
693
- ...prettierOptions,
694
- embeddedLanguageFormatting: OFF,
693
+ formater === "prettier" ? mergePrettierOptions(prettierOptions, {
694
+ embeddedLanguageFormatting: "off",
695
695
  parser: "markdown"
696
- } : {
696
+ }) : {
697
697
  ...dprintOptions,
698
698
  language: "markdown"
699
699
  }
@@ -710,14 +710,13 @@ async function formatters(options = {}, stylistic2 = {}) {
710
710
  rules: {
711
711
  "format/prettier": [
712
712
  ERROR,
713
- {
714
- ...prettierOptions,
713
+ mergePrettierOptions(prettierOptions, {
715
714
  embeddedLanguageFormatting: "off",
716
715
  parser: "slidev",
717
716
  plugins: [
718
717
  "prettier-plugin-slidev"
719
718
  ]
720
- }
719
+ })
721
720
  ]
722
721
  }
723
722
  });
@@ -733,13 +732,12 @@ async function formatters(options = {}, stylistic2 = {}) {
733
732
  rules: {
734
733
  "format/prettier": [
735
734
  ERROR,
736
- {
737
- ...prettierOptions,
735
+ mergePrettierOptions(prettierOptions, {
738
736
  parser: "astro",
739
737
  plugins: [
740
738
  "prettier-plugin-astro"
741
739
  ]
742
- }
740
+ })
743
741
  ]
744
742
  }
745
743
  });
@@ -767,10 +765,9 @@ async function formatters(options = {}, stylistic2 = {}) {
767
765
  rules: {
768
766
  "format/prettier": [
769
767
  ERROR,
770
- {
771
- ...prettierOptions,
768
+ mergePrettierOptions(prettierOptions, {
772
769
  parser: "graphql"
773
- }
770
+ })
774
771
  ]
775
772
  }
776
773
  });
@@ -2320,7 +2317,6 @@ async function vue(options = {}) {
2320
2317
  parserVue,
2321
2318
  processorVueBlocks
2322
2319
  ] = await Promise.all([
2323
- // @ts-expect-error missing types
2324
2320
  interopDefault(import("eslint-plugin-vue")),
2325
2321
  interopDefault(import("vue-eslint-parser")),
2326
2322
  interopDefault(import("eslint-processor-vue-blocks"))