@debbl/eslint-config 3.7.0 → 3.8.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.
Files changed (3) hide show
  1. package/dist/index.cjs +56 -130
  2. package/dist/index.js +56 -130
  3. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -248,10 +248,7 @@ async function imports() {
248
248
  "import/no-named-default": "error",
249
249
  "import/no-self-import": "error",
250
250
  "import/no-webpack-loader-syntax": "error",
251
- "import/newline-after-import": [
252
- "error",
253
- { considerComments: true, count: 1 }
254
- ],
251
+ "import/newline-after-import": ["error", { considerComments: true, count: 1 }],
255
252
  "import/consistent-type-specifier-style": ["error", "prefer-top-level"]
256
253
  }
257
254
  }
@@ -262,9 +259,7 @@ async function imports() {
262
259
  var import_globals = __toESM(require("globals"), 1);
263
260
  var javascript = async (options) => {
264
261
  const { overrides = {} } = options;
265
- const pluginUnusedImports = await interopDefault(
266
- import("eslint-plugin-unused-imports")
267
- );
262
+ const pluginUnusedImports = await interopDefault(import("eslint-plugin-unused-imports"));
268
263
  return [
269
264
  {
270
265
  name: "eslint/javascript/rules",
@@ -294,20 +289,14 @@ var javascript = async (options) => {
294
289
  "unused-imports": pluginUnusedImports
295
290
  },
296
291
  rules: {
297
- "accessor-pairs": [
298
- "error",
299
- { enforceForClassMembers: true, setWithoutGet: true }
300
- ],
292
+ "accessor-pairs": ["error", { enforceForClassMembers: true, setWithoutGet: true }],
301
293
  "array-callback-return": "error",
302
294
  "block-scoped-var": "error",
303
295
  "constructor-super": "error",
304
296
  "default-case-last": "error",
305
297
  "dot-notation": ["error", { allowKeywords: true }],
306
298
  "eqeqeq": ["error", "smart"],
307
- "new-cap": [
308
- "error",
309
- { capIsNew: false, newIsCap: true, properties: true }
310
- ],
299
+ "new-cap": ["error", { capIsNew: false, newIsCap: true, properties: true }],
311
300
  "no-alert": "error",
312
301
  "no-array-constructor": "error",
313
302
  "no-async-promise-executor": "error",
@@ -386,11 +375,7 @@ var javascript = async (options) => {
386
375
  property: "__lookupSetter__"
387
376
  }
388
377
  ],
389
- "no-restricted-syntax": [
390
- "error",
391
- "TSEnumDeclaration[const=true]",
392
- "TSExportAssignment"
393
- ],
378
+ "no-restricted-syntax": ["error", "TSEnumDeclaration[const=true]", "TSExportAssignment"],
394
379
  "no-self-assign": ["error", { props: true }],
395
380
  "no-self-compare": "error",
396
381
  "no-sequences": "error",
@@ -425,10 +410,7 @@ var javascript = async (options) => {
425
410
  vars: "all"
426
411
  }
427
412
  ],
428
- "no-use-before-define": [
429
- "error",
430
- { classes: false, functions: false, variables: true }
431
- ],
413
+ "no-use-before-define": ["error", { classes: false, functions: false, variables: true }],
432
414
  "no-useless-backreference": "error",
433
415
  "no-useless-call": "error",
434
416
  "no-useless-catch": "error",
@@ -479,10 +461,7 @@ var javascript = async (options) => {
479
461
  varsIgnorePattern: "^_"
480
462
  }
481
463
  ],
482
- "use-isnan": [
483
- "error",
484
- { enforceForIndexOf: true, enforceForSwitchCase: true }
485
- ],
464
+ "use-isnan": ["error", { enforceForIndexOf: true, enforceForSwitchCase: true }],
486
465
  "valid-typeof": ["error", { requireStringLiterals: true }],
487
466
  "vars-on-top": "error",
488
467
  "yoda": ["error", "never"],
@@ -579,19 +558,10 @@ var jsonc = async (options) => {
579
558
  "jsonc/vue-custom-block/no-parsing-error": "error",
580
559
  "jsonc/array-bracket-spacing": ["error", "never"],
581
560
  "jsonc/comma-style": ["error", "last"],
582
- "jsonc/key-spacing": [
583
- "error",
584
- { afterColon: true, beforeColon: false }
585
- ],
586
- "jsonc/object-curly-newline": [
587
- "error",
588
- { consistent: true, multiline: true }
589
- ],
561
+ "jsonc/key-spacing": ["error", { afterColon: true, beforeColon: false }],
562
+ "jsonc/object-curly-newline": ["error", { consistent: true, multiline: true }],
590
563
  "jsonc/object-curly-spacing": ["error", "always"],
591
- "jsonc/object-property-newline": [
592
- "error",
593
- { allowMultiplePropertiesPerLine: true }
594
- ],
564
+ "jsonc/object-property-newline": ["error", { allowMultiplePropertiesPerLine: true }],
595
565
  "jsonc/quote-props": "error",
596
566
  "jsonc/quotes": "error",
597
567
  ...overrides
@@ -630,10 +600,7 @@ var markdown = async (options) => {
630
600
  },
631
601
  {
632
602
  name: "eslint/markdown/rules",
633
- files: [
634
- GLOB_MARKDOWN_CODE,
635
- ...componentExts.map((ext) => `${GLOB_MARKDOWN}/**/*.${ext}`)
636
- ],
603
+ files: [GLOB_MARKDOWN_CODE, ...componentExts.map((ext) => `${GLOB_MARKDOWN}/**/*.${ext}`)],
637
604
  languageOptions: {
638
605
  parserOptions: {
639
606
  ecmaFeatures: {
@@ -708,9 +675,7 @@ async function node() {
708
675
 
709
676
  // src/configs/perfectionist.ts
710
677
  async function perfectionist() {
711
- const pluginPerfectionist = await interopDefault(
712
- import("eslint-plugin-perfectionist")
713
- );
678
+ const pluginPerfectionist = await interopDefault(import("eslint-plugin-perfectionist"));
714
679
  return [
715
680
  {
716
681
  name: "eslint/perfectionist/setup",
@@ -718,37 +683,37 @@ async function perfectionist() {
718
683
  perfectionist: pluginPerfectionist
719
684
  },
720
685
  rules: {
721
- "perfectionist/sort-exports": [
722
- "error",
723
- { order: "asc", type: "natural" }
724
- ],
686
+ "perfectionist/sort-exports": ["error", { order: "asc", type: "natural" }],
725
687
  "perfectionist/sort-imports": [
726
688
  "error",
727
689
  {
728
690
  groups: [
729
691
  "builtin",
730
692
  "external",
731
- "type",
732
- ["internal", "internal-type"],
733
- ["parent", "sibling", "index"],
734
- ["parent-type", "sibling-type", "index-type"],
693
+ "internal",
694
+ "parent",
695
+ "sibling",
735
696
  "side-effect",
697
+ "side-effect-style",
698
+ "index",
736
699
  "object",
700
+ "style",
701
+ "builtin-type",
702
+ "external-type",
703
+ "internal-type",
704
+ "parent-type",
705
+ "sibling-type",
706
+ "index-type",
707
+ "type",
737
708
  "unknown"
738
709
  ],
739
- newlinesBetween: "ignore",
710
+ newlinesBetween: "never",
740
711
  order: "asc",
741
712
  type: "natural"
742
713
  }
743
714
  ],
744
- "perfectionist/sort-named-exports": [
745
- "error",
746
- { order: "asc", type: "natural" }
747
- ],
748
- "perfectionist/sort-named-imports": [
749
- "error",
750
- { order: "asc", type: "natural" }
751
- ]
715
+ "perfectionist/sort-named-exports": ["error", { order: "asc", type: "natural" }],
716
+ "perfectionist/sort-named-imports": ["error", { order: "asc", type: "natural" }]
752
717
  }
753
718
  }
754
719
  ];
@@ -761,7 +726,11 @@ var prettier = async ({ tailwindcss: tailwindcss2, ...options }) => {
761
726
  // @ts-expect-error missing types
762
727
  interopDefault(import("eslint-config-prettier"))
763
728
  ]);
764
- const PlainFileRules = [
729
+ const defaultPrettierOptions = {
730
+ printWidth: 100,
731
+ quoteProps: "consistent"
732
+ };
733
+ const plainFileRules = [
765
734
  {
766
735
  name: "eslint/prettier/markdown",
767
736
  files: [GLOB_MARKDOWN],
@@ -813,7 +782,7 @@ var prettier = async ({ tailwindcss: tailwindcss2, ...options }) => {
813
782
  "warn",
814
783
  {
815
784
  parser: rule.parser,
816
- quoteProps: "consistent",
785
+ ...defaultPrettierOptions,
817
786
  ...options
818
787
  }
819
788
  ]
@@ -842,13 +811,13 @@ var prettier = async ({ tailwindcss: tailwindcss2, ...options }) => {
842
811
  "warn",
843
812
  {
844
813
  plugins: tailwindcss2 ? ["prettier-plugin-tailwindcss"] : [],
845
- quoteProps: "consistent",
814
+ ...defaultPrettierOptions,
846
815
  ...options
847
816
  }
848
817
  ]
849
818
  }
850
819
  },
851
- ...PlainFileRules
820
+ ...plainFileRules
852
821
  ];
853
822
  };
854
823
 
@@ -942,14 +911,7 @@ async function sortTsconfig() {
942
911
  "jsonc/sort-keys": [
943
912
  "error",
944
913
  {
945
- order: [
946
- "extends",
947
- "compilerOptions",
948
- "references",
949
- "files",
950
- "include",
951
- "exclude"
952
- ],
914
+ order: ["extends", "compilerOptions", "references", "files", "include", "exclude"],
953
915
  pathPattern: "^$"
954
916
  },
955
917
  {
@@ -1086,10 +1048,7 @@ var test = async (options) => {
1086
1048
  files: GLOB_TESTS,
1087
1049
  rules: {
1088
1050
  "node/prefer-global/process": "off",
1089
- "test/consistent-test-it": [
1090
- "error",
1091
- { fn: "it", withinDescribe: "it" }
1092
- ],
1051
+ "test/consistent-test-it": ["error", { fn: "it", withinDescribe: "it" }],
1093
1052
  "test/no-identical-title": "error",
1094
1053
  "test/no-import-node-test": "error",
1095
1054
  "test/no-only-tests": "error",
@@ -1230,10 +1189,7 @@ var typescript = async (options) => {
1230
1189
  "error",
1231
1190
  { "ts-expect-error": "allow-with-description" }
1232
1191
  ],
1233
- "@typescript-eslint/consistent-type-definitions": [
1234
- "error",
1235
- "interface"
1236
- ],
1192
+ "@typescript-eslint/consistent-type-definitions": ["error", "interface"],
1237
1193
  "@typescript-eslint/consistent-type-imports": [
1238
1194
  "error",
1239
1195
  {
@@ -1246,10 +1202,7 @@ var typescript = async (options) => {
1246
1202
  "@typescript-eslint/method-signature-style": ["error", "property"],
1247
1203
  "@typescript-eslint/no-dupe-class-members": "error",
1248
1204
  "@typescript-eslint/no-dynamic-delete": "off",
1249
- "@typescript-eslint/no-empty-object-type": [
1250
- "error",
1251
- { allowInterfaces: "always" }
1252
- ],
1205
+ "@typescript-eslint/no-empty-object-type": ["error", { allowInterfaces: "always" }],
1253
1206
  "@typescript-eslint/no-explicit-any": "off",
1254
1207
  "@typescript-eslint/no-extraneous-class": "off",
1255
1208
  "@typescript-eslint/no-import-type-side-effects": "error",
@@ -1312,10 +1265,7 @@ async function unicorn() {
1312
1265
  // Pass error message when throwing errors
1313
1266
  "unicorn/error-message": "error",
1314
1267
  // Uppercase regex escapes
1315
- "unicorn/consistent-function-scoping": [
1316
- "error",
1317
- { checkArrowFunctions: false }
1318
- ],
1268
+ "unicorn/consistent-function-scoping": ["error", { checkArrowFunctions: false }],
1319
1269
  // Array.isArray instead of instanceof
1320
1270
  "unicorn/no-instanceof-array": "error",
1321
1271
  // Ban `new Array` as `Array` constructor's params are ambiguous
@@ -1368,9 +1318,7 @@ var vue = async (options = {}) => {
1368
1318
  jsx: true
1369
1319
  },
1370
1320
  extraFileExtensions: [".vue"],
1371
- parser: isTypescript ? await interopDefault(
1372
- import("@typescript-eslint/parser")
1373
- ) : null,
1321
+ parser: isTypescript ? await interopDefault(import("@typescript-eslint/parser")) : null,
1374
1322
  sourceType: "module"
1375
1323
  }
1376
1324
  },
@@ -1399,12 +1347,7 @@ var vue = async (options = {}) => {
1399
1347
  "vue/define-macros-order": [
1400
1348
  "error",
1401
1349
  {
1402
- order: [
1403
- "defineOptions",
1404
- "defineProps",
1405
- "defineEmits",
1406
- "defineSlots"
1407
- ]
1350
+ order: ["defineOptions", "defineProps", "defineEmits", "defineSlots"]
1408
1351
  }
1409
1352
  ],
1410
1353
  "vue/dot-location": ["error", "property"],
@@ -1469,10 +1412,7 @@ var vue = async (options = {}) => {
1469
1412
  "vue/keyword-spacing": ["error", { after: true, before: true }],
1470
1413
  "vue/object-curly-newline": "off",
1471
1414
  "vue/object-curly-spacing": ["error", "always"],
1472
- "vue/object-property-newline": [
1473
- "error",
1474
- { allowMultiplePropertiesPerLine: true }
1475
- ],
1415
+ "vue/object-property-newline": ["error", { allowMultiplePropertiesPerLine: true }],
1476
1416
  "vue/operator-linebreak": ["error", "before"],
1477
1417
  "vue/padding-line-between-blocks": ["error", "always"],
1478
1418
  "vue/quote-props": ["error", "consistent-as-needed"],
@@ -1553,11 +1493,7 @@ async function next() {
1553
1493
  "react-refresh/only-export-components": [
1554
1494
  "warn",
1555
1495
  {
1556
- allowExportNames: [
1557
- "metadata",
1558
- "generateMetadata",
1559
- "generateStaticParams"
1560
- ]
1496
+ allowExportNames: ["metadata", "generateMetadata", "generateStaticParams"]
1561
1497
  }
1562
1498
  ]
1563
1499
  }
@@ -1565,21 +1501,15 @@ async function next() {
1565
1501
  ];
1566
1502
  }
1567
1503
  var react = async (options) => {
1568
- const {
1569
- next: enableNext = false,
1570
- compiler: enableCompiler = false,
1571
- overrides = {}
1572
- } = options;
1573
- const [pluginReact, pluginReactHooks, pluginReactRefresh] = await Promise.all(
1574
- [
1575
- // @ts-expect-error missing types
1576
- interopDefault(import("eslint-plugin-react")),
1577
- // @ts-expect-error missing types
1578
- interopDefault(import("eslint-plugin-react-hooks")),
1579
- // @ts-expect-error missing types
1580
- interopDefault(import("eslint-plugin-react-refresh"))
1581
- ]
1582
- );
1504
+ const { next: enableNext = false, compiler: enableCompiler = false, overrides = {} } = options;
1505
+ const [pluginReact, pluginReactHooks, pluginReactRefresh] = await Promise.all([
1506
+ // @ts-expect-error missing types
1507
+ interopDefault(import("eslint-plugin-react")),
1508
+ // @ts-expect-error missing types
1509
+ interopDefault(import("eslint-plugin-react-hooks")),
1510
+ // @ts-expect-error missing types
1511
+ interopDefault(import("eslint-plugin-react-refresh"))
1512
+ ]);
1583
1513
  const _react = [
1584
1514
  {
1585
1515
  name: "eslint/react/setup",
@@ -1704,11 +1634,7 @@ function defineConfig(options = {}) {
1704
1634
  configs.push(react(getConfigOption(enableReact)));
1705
1635
  }
1706
1636
  if (options.jsonc ?? true) {
1707
- configs.push(
1708
- jsonc(getConfigOption(options.jsonc)),
1709
- sortPackageJson(),
1710
- sortTsconfig()
1711
- );
1637
+ configs.push(jsonc(getConfigOption(options.jsonc)), sortPackageJson(), sortTsconfig());
1712
1638
  }
1713
1639
  if (options.yml ?? true) {
1714
1640
  configs.push(yml(getConfigOption(options.yml)));
package/dist/index.js CHANGED
@@ -165,10 +165,7 @@ async function imports() {
165
165
  "import/no-named-default": "error",
166
166
  "import/no-self-import": "error",
167
167
  "import/no-webpack-loader-syntax": "error",
168
- "import/newline-after-import": [
169
- "error",
170
- { considerComments: true, count: 1 }
171
- ],
168
+ "import/newline-after-import": ["error", { considerComments: true, count: 1 }],
172
169
  "import/consistent-type-specifier-style": ["error", "prefer-top-level"]
173
170
  }
174
171
  }
@@ -179,9 +176,7 @@ async function imports() {
179
176
  import globals from "globals";
180
177
  var javascript = async (options) => {
181
178
  const { overrides = {} } = options;
182
- const pluginUnusedImports = await interopDefault(
183
- import("eslint-plugin-unused-imports")
184
- );
179
+ const pluginUnusedImports = await interopDefault(import("eslint-plugin-unused-imports"));
185
180
  return [
186
181
  {
187
182
  name: "eslint/javascript/rules",
@@ -211,20 +206,14 @@ var javascript = async (options) => {
211
206
  "unused-imports": pluginUnusedImports
212
207
  },
213
208
  rules: {
214
- "accessor-pairs": [
215
- "error",
216
- { enforceForClassMembers: true, setWithoutGet: true }
217
- ],
209
+ "accessor-pairs": ["error", { enforceForClassMembers: true, setWithoutGet: true }],
218
210
  "array-callback-return": "error",
219
211
  "block-scoped-var": "error",
220
212
  "constructor-super": "error",
221
213
  "default-case-last": "error",
222
214
  "dot-notation": ["error", { allowKeywords: true }],
223
215
  "eqeqeq": ["error", "smart"],
224
- "new-cap": [
225
- "error",
226
- { capIsNew: false, newIsCap: true, properties: true }
227
- ],
216
+ "new-cap": ["error", { capIsNew: false, newIsCap: true, properties: true }],
228
217
  "no-alert": "error",
229
218
  "no-array-constructor": "error",
230
219
  "no-async-promise-executor": "error",
@@ -303,11 +292,7 @@ var javascript = async (options) => {
303
292
  property: "__lookupSetter__"
304
293
  }
305
294
  ],
306
- "no-restricted-syntax": [
307
- "error",
308
- "TSEnumDeclaration[const=true]",
309
- "TSExportAssignment"
310
- ],
295
+ "no-restricted-syntax": ["error", "TSEnumDeclaration[const=true]", "TSExportAssignment"],
311
296
  "no-self-assign": ["error", { props: true }],
312
297
  "no-self-compare": "error",
313
298
  "no-sequences": "error",
@@ -342,10 +327,7 @@ var javascript = async (options) => {
342
327
  vars: "all"
343
328
  }
344
329
  ],
345
- "no-use-before-define": [
346
- "error",
347
- { classes: false, functions: false, variables: true }
348
- ],
330
+ "no-use-before-define": ["error", { classes: false, functions: false, variables: true }],
349
331
  "no-useless-backreference": "error",
350
332
  "no-useless-call": "error",
351
333
  "no-useless-catch": "error",
@@ -396,10 +378,7 @@ var javascript = async (options) => {
396
378
  varsIgnorePattern: "^_"
397
379
  }
398
380
  ],
399
- "use-isnan": [
400
- "error",
401
- { enforceForIndexOf: true, enforceForSwitchCase: true }
402
- ],
381
+ "use-isnan": ["error", { enforceForIndexOf: true, enforceForSwitchCase: true }],
403
382
  "valid-typeof": ["error", { requireStringLiterals: true }],
404
383
  "vars-on-top": "error",
405
384
  "yoda": ["error", "never"],
@@ -496,19 +475,10 @@ var jsonc = async (options) => {
496
475
  "jsonc/vue-custom-block/no-parsing-error": "error",
497
476
  "jsonc/array-bracket-spacing": ["error", "never"],
498
477
  "jsonc/comma-style": ["error", "last"],
499
- "jsonc/key-spacing": [
500
- "error",
501
- { afterColon: true, beforeColon: false }
502
- ],
503
- "jsonc/object-curly-newline": [
504
- "error",
505
- { consistent: true, multiline: true }
506
- ],
478
+ "jsonc/key-spacing": ["error", { afterColon: true, beforeColon: false }],
479
+ "jsonc/object-curly-newline": ["error", { consistent: true, multiline: true }],
507
480
  "jsonc/object-curly-spacing": ["error", "always"],
508
- "jsonc/object-property-newline": [
509
- "error",
510
- { allowMultiplePropertiesPerLine: true }
511
- ],
481
+ "jsonc/object-property-newline": ["error", { allowMultiplePropertiesPerLine: true }],
512
482
  "jsonc/quote-props": "error",
513
483
  "jsonc/quotes": "error",
514
484
  ...overrides
@@ -547,10 +517,7 @@ var markdown = async (options) => {
547
517
  },
548
518
  {
549
519
  name: "eslint/markdown/rules",
550
- files: [
551
- GLOB_MARKDOWN_CODE,
552
- ...componentExts.map((ext) => `${GLOB_MARKDOWN}/**/*.${ext}`)
553
- ],
520
+ files: [GLOB_MARKDOWN_CODE, ...componentExts.map((ext) => `${GLOB_MARKDOWN}/**/*.${ext}`)],
554
521
  languageOptions: {
555
522
  parserOptions: {
556
523
  ecmaFeatures: {
@@ -625,9 +592,7 @@ async function node() {
625
592
 
626
593
  // src/configs/perfectionist.ts
627
594
  async function perfectionist() {
628
- const pluginPerfectionist = await interopDefault(
629
- import("eslint-plugin-perfectionist")
630
- );
595
+ const pluginPerfectionist = await interopDefault(import("eslint-plugin-perfectionist"));
631
596
  return [
632
597
  {
633
598
  name: "eslint/perfectionist/setup",
@@ -635,37 +600,37 @@ async function perfectionist() {
635
600
  perfectionist: pluginPerfectionist
636
601
  },
637
602
  rules: {
638
- "perfectionist/sort-exports": [
639
- "error",
640
- { order: "asc", type: "natural" }
641
- ],
603
+ "perfectionist/sort-exports": ["error", { order: "asc", type: "natural" }],
642
604
  "perfectionist/sort-imports": [
643
605
  "error",
644
606
  {
645
607
  groups: [
646
608
  "builtin",
647
609
  "external",
648
- "type",
649
- ["internal", "internal-type"],
650
- ["parent", "sibling", "index"],
651
- ["parent-type", "sibling-type", "index-type"],
610
+ "internal",
611
+ "parent",
612
+ "sibling",
652
613
  "side-effect",
614
+ "side-effect-style",
615
+ "index",
653
616
  "object",
617
+ "style",
618
+ "builtin-type",
619
+ "external-type",
620
+ "internal-type",
621
+ "parent-type",
622
+ "sibling-type",
623
+ "index-type",
624
+ "type",
654
625
  "unknown"
655
626
  ],
656
- newlinesBetween: "ignore",
627
+ newlinesBetween: "never",
657
628
  order: "asc",
658
629
  type: "natural"
659
630
  }
660
631
  ],
661
- "perfectionist/sort-named-exports": [
662
- "error",
663
- { order: "asc", type: "natural" }
664
- ],
665
- "perfectionist/sort-named-imports": [
666
- "error",
667
- { order: "asc", type: "natural" }
668
- ]
632
+ "perfectionist/sort-named-exports": ["error", { order: "asc", type: "natural" }],
633
+ "perfectionist/sort-named-imports": ["error", { order: "asc", type: "natural" }]
669
634
  }
670
635
  }
671
636
  ];
@@ -678,7 +643,11 @@ var prettier = async ({ tailwindcss: tailwindcss2, ...options }) => {
678
643
  // @ts-expect-error missing types
679
644
  interopDefault(import("eslint-config-prettier"))
680
645
  ]);
681
- const PlainFileRules = [
646
+ const defaultPrettierOptions = {
647
+ printWidth: 100,
648
+ quoteProps: "consistent"
649
+ };
650
+ const plainFileRules = [
682
651
  {
683
652
  name: "eslint/prettier/markdown",
684
653
  files: [GLOB_MARKDOWN],
@@ -730,7 +699,7 @@ var prettier = async ({ tailwindcss: tailwindcss2, ...options }) => {
730
699
  "warn",
731
700
  {
732
701
  parser: rule.parser,
733
- quoteProps: "consistent",
702
+ ...defaultPrettierOptions,
734
703
  ...options
735
704
  }
736
705
  ]
@@ -759,13 +728,13 @@ var prettier = async ({ tailwindcss: tailwindcss2, ...options }) => {
759
728
  "warn",
760
729
  {
761
730
  plugins: tailwindcss2 ? ["prettier-plugin-tailwindcss"] : [],
762
- quoteProps: "consistent",
731
+ ...defaultPrettierOptions,
763
732
  ...options
764
733
  }
765
734
  ]
766
735
  }
767
736
  },
768
- ...PlainFileRules
737
+ ...plainFileRules
769
738
  ];
770
739
  };
771
740
 
@@ -859,14 +828,7 @@ async function sortTsconfig() {
859
828
  "jsonc/sort-keys": [
860
829
  "error",
861
830
  {
862
- order: [
863
- "extends",
864
- "compilerOptions",
865
- "references",
866
- "files",
867
- "include",
868
- "exclude"
869
- ],
831
+ order: ["extends", "compilerOptions", "references", "files", "include", "exclude"],
870
832
  pathPattern: "^$"
871
833
  },
872
834
  {
@@ -1003,10 +965,7 @@ var test = async (options) => {
1003
965
  files: GLOB_TESTS,
1004
966
  rules: {
1005
967
  "node/prefer-global/process": "off",
1006
- "test/consistent-test-it": [
1007
- "error",
1008
- { fn: "it", withinDescribe: "it" }
1009
- ],
968
+ "test/consistent-test-it": ["error", { fn: "it", withinDescribe: "it" }],
1010
969
  "test/no-identical-title": "error",
1011
970
  "test/no-import-node-test": "error",
1012
971
  "test/no-only-tests": "error",
@@ -1147,10 +1106,7 @@ var typescript = async (options) => {
1147
1106
  "error",
1148
1107
  { "ts-expect-error": "allow-with-description" }
1149
1108
  ],
1150
- "@typescript-eslint/consistent-type-definitions": [
1151
- "error",
1152
- "interface"
1153
- ],
1109
+ "@typescript-eslint/consistent-type-definitions": ["error", "interface"],
1154
1110
  "@typescript-eslint/consistent-type-imports": [
1155
1111
  "error",
1156
1112
  {
@@ -1163,10 +1119,7 @@ var typescript = async (options) => {
1163
1119
  "@typescript-eslint/method-signature-style": ["error", "property"],
1164
1120
  "@typescript-eslint/no-dupe-class-members": "error",
1165
1121
  "@typescript-eslint/no-dynamic-delete": "off",
1166
- "@typescript-eslint/no-empty-object-type": [
1167
- "error",
1168
- { allowInterfaces: "always" }
1169
- ],
1122
+ "@typescript-eslint/no-empty-object-type": ["error", { allowInterfaces: "always" }],
1170
1123
  "@typescript-eslint/no-explicit-any": "off",
1171
1124
  "@typescript-eslint/no-extraneous-class": "off",
1172
1125
  "@typescript-eslint/no-import-type-side-effects": "error",
@@ -1229,10 +1182,7 @@ async function unicorn() {
1229
1182
  // Pass error message when throwing errors
1230
1183
  "unicorn/error-message": "error",
1231
1184
  // Uppercase regex escapes
1232
- "unicorn/consistent-function-scoping": [
1233
- "error",
1234
- { checkArrowFunctions: false }
1235
- ],
1185
+ "unicorn/consistent-function-scoping": ["error", { checkArrowFunctions: false }],
1236
1186
  // Array.isArray instead of instanceof
1237
1187
  "unicorn/no-instanceof-array": "error",
1238
1188
  // Ban `new Array` as `Array` constructor's params are ambiguous
@@ -1285,9 +1235,7 @@ var vue = async (options = {}) => {
1285
1235
  jsx: true
1286
1236
  },
1287
1237
  extraFileExtensions: [".vue"],
1288
- parser: isTypescript ? await interopDefault(
1289
- import("@typescript-eslint/parser")
1290
- ) : null,
1238
+ parser: isTypescript ? await interopDefault(import("@typescript-eslint/parser")) : null,
1291
1239
  sourceType: "module"
1292
1240
  }
1293
1241
  },
@@ -1316,12 +1264,7 @@ var vue = async (options = {}) => {
1316
1264
  "vue/define-macros-order": [
1317
1265
  "error",
1318
1266
  {
1319
- order: [
1320
- "defineOptions",
1321
- "defineProps",
1322
- "defineEmits",
1323
- "defineSlots"
1324
- ]
1267
+ order: ["defineOptions", "defineProps", "defineEmits", "defineSlots"]
1325
1268
  }
1326
1269
  ],
1327
1270
  "vue/dot-location": ["error", "property"],
@@ -1386,10 +1329,7 @@ var vue = async (options = {}) => {
1386
1329
  "vue/keyword-spacing": ["error", { after: true, before: true }],
1387
1330
  "vue/object-curly-newline": "off",
1388
1331
  "vue/object-curly-spacing": ["error", "always"],
1389
- "vue/object-property-newline": [
1390
- "error",
1391
- { allowMultiplePropertiesPerLine: true }
1392
- ],
1332
+ "vue/object-property-newline": ["error", { allowMultiplePropertiesPerLine: true }],
1393
1333
  "vue/operator-linebreak": ["error", "before"],
1394
1334
  "vue/padding-line-between-blocks": ["error", "always"],
1395
1335
  "vue/quote-props": ["error", "consistent-as-needed"],
@@ -1470,11 +1410,7 @@ async function next() {
1470
1410
  "react-refresh/only-export-components": [
1471
1411
  "warn",
1472
1412
  {
1473
- allowExportNames: [
1474
- "metadata",
1475
- "generateMetadata",
1476
- "generateStaticParams"
1477
- ]
1413
+ allowExportNames: ["metadata", "generateMetadata", "generateStaticParams"]
1478
1414
  }
1479
1415
  ]
1480
1416
  }
@@ -1482,21 +1418,15 @@ async function next() {
1482
1418
  ];
1483
1419
  }
1484
1420
  var react = async (options) => {
1485
- const {
1486
- next: enableNext = false,
1487
- compiler: enableCompiler = false,
1488
- overrides = {}
1489
- } = options;
1490
- const [pluginReact, pluginReactHooks, pluginReactRefresh] = await Promise.all(
1491
- [
1492
- // @ts-expect-error missing types
1493
- interopDefault(import("eslint-plugin-react")),
1494
- // @ts-expect-error missing types
1495
- interopDefault(import("eslint-plugin-react-hooks")),
1496
- // @ts-expect-error missing types
1497
- interopDefault(import("eslint-plugin-react-refresh"))
1498
- ]
1499
- );
1421
+ const { next: enableNext = false, compiler: enableCompiler = false, overrides = {} } = options;
1422
+ const [pluginReact, pluginReactHooks, pluginReactRefresh] = await Promise.all([
1423
+ // @ts-expect-error missing types
1424
+ interopDefault(import("eslint-plugin-react")),
1425
+ // @ts-expect-error missing types
1426
+ interopDefault(import("eslint-plugin-react-hooks")),
1427
+ // @ts-expect-error missing types
1428
+ interopDefault(import("eslint-plugin-react-refresh"))
1429
+ ]);
1500
1430
  const _react = [
1501
1431
  {
1502
1432
  name: "eslint/react/setup",
@@ -1621,11 +1551,7 @@ function defineConfig(options = {}) {
1621
1551
  configs.push(react(getConfigOption(enableReact)));
1622
1552
  }
1623
1553
  if (options.jsonc ?? true) {
1624
- configs.push(
1625
- jsonc(getConfigOption(options.jsonc)),
1626
- sortPackageJson(),
1627
- sortTsconfig()
1628
- );
1554
+ configs.push(jsonc(getConfigOption(options.jsonc)), sortPackageJson(), sortTsconfig());
1629
1555
  }
1630
1556
  if (options.yml ?? true) {
1631
1557
  configs.push(yml(getConfigOption(options.yml)));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@debbl/eslint-config",
3
3
  "type": "module",
4
- "version": "3.7.0",
4
+ "version": "3.8.0",
5
5
  "description": "Brendan Dash's ESLint config",
6
6
  "author": "Debbl <me@aiwan.run> (https://github.com/Debbl/)",
7
7
  "license": "MIT",