@rebeccastevens/eslint-config 3.0.5 → 3.0.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 CHANGED
@@ -103,9 +103,7 @@ async function installPackages(packages) {
103
103
  /* eslint-enable functional/no-loop-statements */
104
104
 
105
105
  async function comments() {
106
- const [pluginComments] = (await loadPackages([
107
- "eslint-plugin-eslint-comments",
108
- ]));
106
+ const [pluginComments] = (await loadPackages(["eslint-plugin-eslint-comments"]));
109
107
  return [
110
108
  {
111
109
  name: "rs:comments",
@@ -227,14 +225,13 @@ async function formatters(opts, stylistic) {
227
225
  slidev: localPkg.isPackageExists("@slidev/cli"),
228
226
  }
229
227
  : opts;
230
- if (options.slidev !== false &&
231
- options.slidev !== undefined &&
232
- options.markdown !== true) {
228
+ if (options.slidev !== false && options.slidev !== undefined && options.markdown !== true) {
233
229
  throw new Error("`slidev` option only works when `markdown` is enabled with `prettier`");
234
230
  }
235
231
  const { indent, quotes, semi } = stylistic;
236
232
  const prettierOptions = Object.assign({
237
233
  endOfLine: "lf",
234
+ printWidth: 120,
238
235
  semi: semi ?? true,
239
236
  singleQuote: quotes === "single",
240
237
  tabWidth: typeof indent === "number" ? indent : 2,
@@ -706,7 +703,6 @@ async function formatters(opts, stylistic) {
706
703
  "format/prettier": [
707
704
  "error",
708
705
  {
709
- printWidth: 120,
710
706
  ...prettierOptions,
711
707
  embeddedLanguageFormatting: "off",
712
708
  parser: "markdown",
@@ -726,7 +722,6 @@ async function formatters(opts, stylistic) {
726
722
  "format/prettier": [
727
723
  "error",
728
724
  {
729
- printWidth: 120,
730
725
  ...prettierOptions,
731
726
  embeddedLanguageFormatting: "off",
732
727
  parser: "slidev",
@@ -763,9 +758,7 @@ async function functional(options) {
763
758
  const { mode, overrides, stylistic, filesTypeAware, functionalEnforcement, ignoreNamePattern,
764
759
  // ignoreTypePattern,
765
760
  } = options;
766
- const [pluginFunctional] = (await loadPackages([
767
- "eslint-plugin-functional",
768
- ]));
761
+ const [pluginFunctional] = (await loadPackages(["eslint-plugin-functional"]));
769
762
  const strictRules = {
770
763
  "functional/functional-parameters": "error",
771
764
  "functional/no-throw-statements": "error",
@@ -962,8 +955,7 @@ async function functional(options) {
962
955
  ...recommendedRules["functional/prefer-immutable-types"][1],
963
956
  overrides: [
964
957
  {
965
- ...recommendedRules["functional/prefer-immutable-types"][1]
966
- .overrides[0],
958
+ ...recommendedRules["functional/prefer-immutable-types"][1].overrides[0],
967
959
  specifiers: [
968
960
  {
969
961
  from: "file",
@@ -976,10 +968,7 @@ async function functional(options) {
976
968
  };
977
969
  const noneLibraryRules = {
978
970
  "functional/prefer-immutable-types": liteRules["functional/prefer-immutable-types"],
979
- "functional/type-declaration-immutability": [
980
- "warn",
981
- liteRules["functional/type-declaration-immutability"][1],
982
- ],
971
+ "functional/type-declaration-immutability": ["warn", liteRules["functional/type-declaration-immutability"][1]],
983
972
  };
984
973
  return [
985
974
  {
@@ -1039,10 +1028,7 @@ async function ignores(options) {
1039
1028
  return null;
1040
1029
  });
1041
1030
  }));
1042
- return [
1043
- ignoreConfig,
1044
- ...ignoreFileConfigs.filter((v) => v !== null),
1045
- ];
1031
+ return [ignoreConfig, ...ignoreFileConfigs.filter((v) => v !== null)];
1046
1032
  }
1047
1033
 
1048
1034
  async function imports(options) {
@@ -1060,10 +1046,7 @@ async function imports(options) {
1060
1046
  import: pluginImport,
1061
1047
  },
1062
1048
  settings: {
1063
- "import-x/external-module-folders": [
1064
- "node_modules",
1065
- "node_modules/@types",
1066
- ],
1049
+ "import-x/external-module-folders": ["node_modules", "node_modules/@types"],
1067
1050
  "import-x/internal-regex": "^(?:#|(?:@|~)\\/).*",
1068
1051
  "import-x/extensions": [".ts", ".tsx", ".js", ".jsx"],
1069
1052
  "import-x/parsers": {
@@ -1177,10 +1160,7 @@ async function imports(options) {
1177
1160
  "import/no-webpack-loader-syntax": "error",
1178
1161
  // "import/prefer-default-export": "off",
1179
1162
  // "import/unambiguous": "off",
1180
- "import/newline-after-import": [
1181
- stylistic === false ? "off" : "error",
1182
- { count: 1 },
1183
- ],
1163
+ "import/newline-after-import": [stylistic === false ? "off" : "error", { count: 1 }],
1184
1164
  "import/order": [
1185
1165
  stylistic === false ? "off" : "error",
1186
1166
  {
@@ -1188,14 +1168,7 @@ async function imports(options) {
1188
1168
  caseInsensitive: false,
1189
1169
  order: "asc",
1190
1170
  },
1191
- groups: [
1192
- "builtin",
1193
- "external",
1194
- "internal",
1195
- "parent",
1196
- "sibling",
1197
- "index",
1198
- ],
1171
+ groups: ["builtin", "external", "internal", "parent", "sibling", "index"],
1199
1172
  "newlines-between": "always",
1200
1173
  },
1201
1174
  ],
@@ -1540,11 +1513,7 @@ function javascript(options) {
1540
1513
  "no-useless-return": "error",
1541
1514
  "no-var": "error",
1542
1515
  "no-with": "error",
1543
- "object-shorthand": [
1544
- "error",
1545
- "always",
1546
- { avoidQuotes: true, ignoreConstructors: false },
1547
- ],
1516
+ "object-shorthand": ["error", "always", { avoidQuotes: true, ignoreConstructors: false }],
1548
1517
  "one-var": [
1549
1518
  "error",
1550
1519
  {
@@ -1554,14 +1523,8 @@ function javascript(options) {
1554
1523
  },
1555
1524
  ],
1556
1525
  "operator-assignment": ["error", "always"],
1557
- "prefer-arrow-callback": [
1558
- "error",
1559
- { allowNamedFunctions: false, allowUnboundThis: true },
1560
- ],
1561
- "prefer-const": [
1562
- "error",
1563
- { destructuring: "all", ignoreReadBeforeAssign: true },
1564
- ],
1526
+ "prefer-arrow-callback": ["error", { allowNamedFunctions: false, allowUnboundThis: true }],
1527
+ "prefer-const": ["error", { destructuring: "all", ignoreReadBeforeAssign: true }],
1565
1528
  "prefer-destructuring": [
1566
1529
  "error",
1567
1530
  {
@@ -1597,10 +1560,7 @@ function javascript(options) {
1597
1560
  strict: ["error", "never"],
1598
1561
  "symbol-description": "error",
1599
1562
  "unicode-bom": ["error", "never"],
1600
- "use-isnan": [
1601
- "error",
1602
- { enforceForIndexOf: true, enforceForSwitchCase: true },
1603
- ],
1563
+ "use-isnan": ["error", { enforceForIndexOf: true, enforceForSwitchCase: true }],
1604
1564
  "valid-typeof": ["error", { requireStringLiterals: true }],
1605
1565
  "vars-on-top": "error",
1606
1566
  yoda: ["error", "never"],
@@ -1645,13 +1605,7 @@ async function jsdoc(options) {
1645
1605
  "jsdoc/no-bad-blocks": [
1646
1606
  "error",
1647
1607
  {
1648
- ignore: [
1649
- "ts-check",
1650
- "ts-expect-error",
1651
- "ts-ignore",
1652
- "ts-nocheck",
1653
- "vue-ignore",
1654
- ],
1608
+ ignore: ["ts-check", "ts-expect-error", "ts-ignore", "ts-nocheck", "vue-ignore"],
1655
1609
  },
1656
1610
  ],
1657
1611
  "jsdoc/no-defaults": "warn",
@@ -1708,10 +1662,7 @@ async function jsdoc(options) {
1708
1662
  async function jsonc(options) {
1709
1663
  const { files, overrides, stylistic } = options;
1710
1664
  const { indent = 2 } = typeof stylistic === "boolean" ? {} : stylistic;
1711
- const [pluginJsonc, parserJsonc] = (await loadPackages([
1712
- "eslint-plugin-jsonc",
1713
- "jsonc-eslint-parser",
1714
- ]));
1665
+ const [pluginJsonc, parserJsonc] = (await loadPackages(["eslint-plugin-jsonc", "jsonc-eslint-parser"]));
1715
1666
  const stylisticEnforcement = stylistic === false ? "off" : "error";
1716
1667
  return [
1717
1668
  {
@@ -1757,19 +1708,10 @@ async function jsonc(options) {
1757
1708
  "jsonc/comma-dangle": [stylisticEnforcement, "never"],
1758
1709
  "jsonc/comma-style": [stylisticEnforcement, "last"],
1759
1710
  "jsonc/indent": [stylisticEnforcement, indent],
1760
- "jsonc/key-spacing": [
1761
- stylisticEnforcement,
1762
- { afterColon: true, beforeColon: false },
1763
- ],
1764
- "jsonc/object-curly-newline": [
1765
- stylisticEnforcement,
1766
- { consistent: true, multiline: true },
1767
- ],
1711
+ "jsonc/key-spacing": [stylisticEnforcement, { afterColon: true, beforeColon: false }],
1712
+ "jsonc/object-curly-newline": [stylisticEnforcement, { consistent: true, multiline: true }],
1768
1713
  "jsonc/object-curly-spacing": [stylisticEnforcement, "always"],
1769
- "jsonc/object-property-newline": [
1770
- stylisticEnforcement,
1771
- { allowMultiplePropertiesPerLine: true },
1772
- ],
1714
+ "jsonc/object-property-newline": [stylisticEnforcement, { allowMultiplePropertiesPerLine: true }],
1773
1715
  "jsonc/quote-props": stylisticEnforcement,
1774
1716
  "jsonc/quotes": stylisticEnforcement,
1775
1717
  ...overrides,
@@ -1817,15 +1759,10 @@ async function markdown(options) {
1817
1759
  },
1818
1760
  {
1819
1761
  name: "rs:markdown:code",
1820
- files: [
1821
- GLOB_MARKDOWN_CODE,
1822
- ...componentExts.map((ext) => `${GLOB_MARKDOWN}/*.${ext}`),
1823
- ],
1762
+ files: [GLOB_MARKDOWN_CODE, ...componentExts.map((ext) => `${GLOB_MARKDOWN}/*.${ext}`)],
1824
1763
  languageOptions: {
1825
1764
  parserOptions: {
1826
- ...(enableTypeRequiredRules
1827
- ? undefined
1828
- : { project: false, projectService: false, program: null }),
1765
+ ...(enableTypeRequiredRules ? undefined : { project: false, projectService: false, program: null }),
1829
1766
  ecmaFeatures: {
1830
1767
  impliedStrict: true,
1831
1768
  },
@@ -2066,14 +2003,7 @@ function sortTsconfig() {
2066
2003
  "jsonc/sort-keys": [
2067
2004
  "error",
2068
2005
  {
2069
- order: [
2070
- "extends",
2071
- "compilerOptions",
2072
- "references",
2073
- "files",
2074
- "include",
2075
- "exclude",
2076
- ],
2006
+ order: ["extends", "compilerOptions", "references", "files", "include", "exclude"],
2077
2007
  pathPattern: "^$",
2078
2008
  },
2079
2009
  {
@@ -2191,9 +2121,7 @@ const StylisticConfigDefaults = {
2191
2121
  };
2192
2122
  async function stylistic(options) {
2193
2123
  const { stylistic: { indent, jsx, quotes, semi }, overrides, typescript, } = options;
2194
- const [pluginStylistic] = (await loadPackages([
2195
- "@stylistic/eslint-plugin",
2196
- ]));
2124
+ const [pluginStylistic] = (await loadPackages(["@stylistic/eslint-plugin"]));
2197
2125
  const config = pluginStylistic.configs.customize({
2198
2126
  flat: true,
2199
2127
  indent,
@@ -2260,10 +2188,7 @@ async function stylistic(options) {
2260
2188
  },
2261
2189
  ],
2262
2190
  "style/indent-binary-ops": "error",
2263
- "style/key-spacing": [
2264
- "error",
2265
- { beforeColon: false, afterColon: true },
2266
- ],
2191
+ "style/key-spacing": ["error", { beforeColon: false, afterColon: true }],
2267
2192
  "style/keyword-spacing": ["error", { before: true, after: true }],
2268
2193
  "style/linebreak-style": ["error", "unix"],
2269
2194
  "style/lines-around-comment": [
@@ -2311,15 +2236,8 @@ async function stylistic(options) {
2311
2236
  "style/max-statements-per-line": ["error", { max: 1 }],
2312
2237
  "style/multiline-ternary": ["error", "always-multiline"],
2313
2238
  "style/new-parens": "error",
2314
- "style/newline-per-chained-call": [
2315
- "error",
2316
- { ignoreChainWithDepth: 2 },
2317
- ],
2318
- "style/no-extra-parens": [
2319
- "error",
2320
- "all",
2321
- { nestedBinaryExpressions: false },
2322
- ],
2239
+ "style/newline-per-chained-call": ["error", { ignoreChainWithDepth: 2 }],
2240
+ "style/no-extra-parens": ["error", "all", { nestedBinaryExpressions: false }],
2323
2241
  "style/no-extra-semi": "error",
2324
2242
  "style/no-floating-decimal": "error",
2325
2243
  "style/no-mixed-operators": [
@@ -2341,11 +2259,7 @@ async function stylistic(options) {
2341
2259
  "style/no-tabs": "error",
2342
2260
  "style/no-trailing-spaces": "error",
2343
2261
  "style/no-whitespace-before-property": "error",
2344
- "style/nonblock-statement-body-position": [
2345
- "error",
2346
- "beside",
2347
- { overrides: {} },
2348
- ],
2262
+ "style/nonblock-statement-body-position": ["error", "beside", { overrides: {} }],
2349
2263
  "style/object-curly-newline": [
2350
2264
  "error",
2351
2265
  {
@@ -2362,10 +2276,7 @@ async function stylistic(options) {
2362
2276
  },
2363
2277
  ],
2364
2278
  "style/object-curly-spacing": ["error", "always"],
2365
- "style/object-property-newline": [
2366
- "error",
2367
- { allowAllPropertiesOnSameLine: true },
2368
- ],
2279
+ "style/object-property-newline": ["error", { allowAllPropertiesOnSameLine: true }],
2369
2280
  "style/one-var-declaration-per-line": ["error", "always"],
2370
2281
  "style/operator-linebreak": [
2371
2282
  "error",
@@ -2389,11 +2300,7 @@ async function stylistic(options) {
2389
2300
  },
2390
2301
  ],
2391
2302
  "style/quote-props": ["error", "consistent-as-needed"],
2392
- "style/quotes": [
2393
- "error",
2394
- quotes,
2395
- { avoidEscape: true, allowTemplateLiterals: true },
2396
- ],
2303
+ "style/quotes": ["error", quotes, { avoidEscape: true, allowTemplateLiterals: true }],
2397
2304
  "style/rest-spread-spacing": ["error", "never"],
2398
2305
  "style/semi-spacing": ["error", { before: false, after: true }],
2399
2306
  "style/semi-style": ["error", "last"],
@@ -2428,11 +2335,7 @@ async function stylistic(options) {
2428
2335
  "style/switch-colon-spacing": ["error", { after: true, before: false }],
2429
2336
  "style/template-curly-spacing": ["error", "never"],
2430
2337
  "style/template-tag-spacing": ["error", "never"],
2431
- "style/wrap-iife": [
2432
- "error",
2433
- "inside",
2434
- { functionPrototypeMethods: true },
2435
- ],
2338
+ "style/wrap-iife": ["error", "inside", { functionPrototypeMethods: true }],
2436
2339
  "style/yield-star-spacing": ["error", "after"],
2437
2340
  ...(typescript
2438
2341
  ? {
@@ -2485,10 +2388,7 @@ async function test(options) {
2485
2388
  "regexp/no-super-linear-backtracking": "off",
2486
2389
  "sonar/no-duplicate-string": "off",
2487
2390
  "sonar/no-identical-functions": "off",
2488
- "test/consistent-test-it": [
2489
- "error",
2490
- { fn: "it", withinDescribe: "it" },
2491
- ],
2391
+ "test/consistent-test-it": ["error", { fn: "it", withinDescribe: "it" }],
2492
2392
  "test/no-identical-title": "error",
2493
2393
  "test/no-import-node-test": "error",
2494
2394
  "test/no-only-tests": "error",
@@ -2514,10 +2414,7 @@ async function test(options) {
2514
2414
  async function toml(options) {
2515
2415
  const { files, overrides, stylistic } = options;
2516
2416
  const { indent = 2 } = typeof stylistic === "boolean" ? {} : stylistic;
2517
- const [pluginToml, parserToml] = (await loadPackages([
2518
- "eslint-plugin-toml",
2519
- "toml-eslint-parser",
2520
- ]));
2417
+ const [pluginToml, parserToml] = (await loadPackages(["eslint-plugin-toml", "toml-eslint-parser"]));
2521
2418
  const stylisticEnforcement = stylistic === false ? "off" : "error";
2522
2419
  return [
2523
2420
  {
@@ -2603,10 +2500,7 @@ async function typescript(options) {
2603
2500
  "consistent-return": "off", // Don't turn on ts version
2604
2501
  "import/named": "off",
2605
2502
  "no-undef": "off",
2606
- "ts/array-type": [
2607
- "error",
2608
- { default: "array-simple", readonly: "generic" },
2609
- ],
2503
+ "ts/array-type": ["error", { default: "array-simple", readonly: "generic" }],
2610
2504
  "ts/await-thenable": "error",
2611
2505
  "ts/ban-ts-comment": ["error", { minimumDescriptionLength: 10 }],
2612
2506
  "ts/explicit-function-return-type": [
@@ -2618,16 +2512,10 @@ async function typescript(options) {
2618
2512
  allowTypedFunctionExpressions: true,
2619
2513
  },
2620
2514
  ],
2621
- "ts/explicit-member-accessibility": [
2622
- "error",
2623
- { accessibility: "explicit" },
2624
- ],
2515
+ "ts/explicit-member-accessibility": ["error", { accessibility: "explicit" }],
2625
2516
  "ts/no-array-delete": "error",
2626
2517
  "ts/no-base-to-string": "error",
2627
- "ts/no-confusing-void-expression": [
2628
- "error",
2629
- { ignoreArrowShorthand: false, ignoreVoidOperator: true },
2630
- ],
2518
+ "ts/no-confusing-void-expression": ["error", { ignoreArrowShorthand: false, ignoreVoidOperator: true }],
2631
2519
  "ts/no-duplicate-enum-values": "error",
2632
2520
  "ts/no-duplicate-type-constituents": "error",
2633
2521
  "ts/no-dynamic-delete": "error",
@@ -2650,10 +2538,7 @@ async function typescript(options) {
2650
2538
  "ts/no-redundant-type-constituents": "error",
2651
2539
  "ts/no-this-alias": "error",
2652
2540
  "ts/no-unnecessary-boolean-literal-compare": "error",
2653
- "ts/no-unnecessary-condition": [
2654
- "error",
2655
- { allowConstantLoopConditions: true },
2656
- ],
2541
+ "ts/no-unnecessary-condition": ["error", { allowConstantLoopConditions: true }],
2657
2542
  "ts/no-unnecessary-type-arguments": "error",
2658
2543
  "ts/no-unnecessary-type-assertion": "error",
2659
2544
  "ts/no-unnecessary-type-constraint": "error",
@@ -2724,10 +2609,7 @@ async function typescript(options) {
2724
2609
  ],
2725
2610
  "ts/switch-exhaustiveness-check": "error",
2726
2611
  "ts/unbound-method": ["error", { ignoreStatic: true }],
2727
- "ts/unified-signatures": [
2728
- "error",
2729
- { ignoreDifferentlyNamedParameters: true },
2730
- ],
2612
+ "ts/unified-signatures": ["error", { ignoreDifferentlyNamedParameters: true }],
2731
2613
  "ts/use-unknown-in-catch-callback-variable": "error",
2732
2614
  "no-use-before-define": "off",
2733
2615
  "ts/no-use-before-define": [
@@ -2769,10 +2651,7 @@ async function typescript(options) {
2769
2651
  "no-throw-literal": "off",
2770
2652
  "ts/only-throw-error": "error",
2771
2653
  "dot-notation": "off",
2772
- "ts/dot-notation": [
2773
- "error",
2774
- { allowIndexSignaturePropertyAccess: true },
2775
- ],
2654
+ "ts/dot-notation": ["error", { allowIndexSignaturePropertyAccess: true }],
2776
2655
  "ts/consistent-indexed-object-style": "error",
2777
2656
  "ts/consistent-type-definitions": ["error", "type"],
2778
2657
  "class-methods-use-this": "off",
@@ -2900,12 +2779,7 @@ async function typescript(options) {
2900
2779
  trailingUnderscore: "forbid",
2901
2780
  },
2902
2781
  {
2903
- selector: [
2904
- "accessor",
2905
- "classMethod",
2906
- "typeMethod",
2907
- "typeProperty",
2908
- ],
2782
+ selector: ["accessor", "classMethod", "typeMethod", "typeProperty"],
2909
2783
  format: ["camelCase", "PascalCase", "UPPER_CASE"],
2910
2784
  leadingUnderscore: "allow",
2911
2785
  trailingUnderscore: "forbid",
@@ -2935,8 +2809,7 @@ async function typescript(options) {
2935
2809
  name: "rs:typescript:rules-non-type-aware",
2936
2810
  files,
2937
2811
  ignores: filesTypeAware,
2938
- rules: ((pluginTs.configs?.["disable-type-checked"])
2939
- .rules ?? {}),
2812
+ rules: ((pluginTs.configs?.["disable-type-checked"]).rules ?? {}),
2940
2813
  },
2941
2814
  {
2942
2815
  name: "rs:typescript:tests-overrides",
@@ -3111,10 +2984,10 @@ async function unocss(options) {
3111
2984
 
3112
2985
  /* eslint-enable ts/naming-convention */
3113
2986
  async function vue(options) {
3114
- const { files, i18n, overrides, parserOptions, stylistic, typescript, vueVersion, } = options;
2987
+ const { files, i18n, overrides, parserOptions, stylistic, typescript, vueVersion } = options;
3115
2988
  const sfcBlocks = options.sfcBlocks === true ? {} : options.sfcBlocks;
3116
2989
  const { indent = 2 } = typeof stylistic === "boolean" ? {} : stylistic;
3117
- const [pluginVue, pluginVueI18n, parserVue, processorVueBlocks, { mergeProcessors },] = (await loadPackages([
2990
+ const [pluginVue, pluginVueI18n, parserVue, processorVueBlocks, { mergeProcessors }] = (await loadPackages([
3118
2991
  "eslint-plugin-vue",
3119
2992
  "@intlify/eslint-plugin-vue-i18n",
3120
2993
  "vue-eslint-parser",
@@ -3213,12 +3086,7 @@ async function vue(options) {
3213
3086
  "vue/define-macros-order": [
3214
3087
  "error",
3215
3088
  {
3216
- order: [
3217
- "defineOptions",
3218
- "defineProps",
3219
- "defineEmits",
3220
- "defineSlots",
3221
- ],
3089
+ order: ["defineOptions", "defineProps", "defineEmits", "defineSlots"],
3222
3090
  },
3223
3091
  ],
3224
3092
  "vue/dot-location": ["error", "property"],
@@ -3232,12 +3100,7 @@ async function vue(options) {
3232
3100
  "vue/no-empty-pattern": "error",
3233
3101
  "vue/no-irregular-whitespace": "error",
3234
3102
  "vue/no-loss-of-precision": "error",
3235
- "vue/no-restricted-syntax": [
3236
- "error",
3237
- "DebuggerStatement",
3238
- "LabeledStatement",
3239
- "WithStatement",
3240
- ],
3103
+ "vue/no-restricted-syntax": ["error", "DebuggerStatement", "LabeledStatement", "WithStatement"],
3241
3104
  "vue/no-restricted-v-bind": ["error", "/^v-/"],
3242
3105
  // "vue/no-setup-props-reactivity-loss": "off",
3243
3106
  "vue/no-sparse-arrays": "error",
@@ -3264,10 +3127,7 @@ async function vue(options) {
3264
3127
  "vue-i18n/no-raw-text": i18n === false ? "off" : "warn",
3265
3128
  "vue-i18n/no-v-html": i18n === false ? "off" : "error",
3266
3129
  "vue/array-bracket-spacing": [stylisticEnforcement, "never"],
3267
- "vue/arrow-spacing": [
3268
- stylisticEnforcement,
3269
- { after: true, before: true },
3270
- ],
3130
+ "vue/arrow-spacing": [stylisticEnforcement, { after: true, before: true }],
3271
3131
  "vue/block-spacing": [stylisticEnforcement, "always"],
3272
3132
  "vue/block-tag-newline": [
3273
3133
  stylisticEnforcement,
@@ -3283,10 +3143,7 @@ async function vue(options) {
3283
3143
  { allowSingleLine: true },
3284
3144
  ],
3285
3145
  "vue/comma-dangle": [stylisticEnforcement, "always-multiline"],
3286
- "vue/comma-spacing": [
3287
- stylisticEnforcement,
3288
- { after: true, before: false },
3289
- ],
3146
+ "vue/comma-spacing": [stylisticEnforcement, { after: true, before: false }],
3290
3147
  "vue/comma-style": [stylisticEnforcement, "last"],
3291
3148
  "vue/html-comment-content-spacing": [
3292
3149
  stylisticEnforcement,
@@ -3295,20 +3152,11 @@ async function vue(options) {
3295
3152
  exceptions: ["-"],
3296
3153
  },
3297
3154
  ],
3298
- "vue/key-spacing": [
3299
- stylisticEnforcement,
3300
- { afterColon: true, beforeColon: false },
3301
- ],
3302
- "vue/keyword-spacing": [
3303
- stylisticEnforcement,
3304
- { after: true, before: true },
3305
- ],
3155
+ "vue/key-spacing": [stylisticEnforcement, { afterColon: true, beforeColon: false }],
3156
+ "vue/keyword-spacing": [stylisticEnforcement, { after: true, before: true }],
3306
3157
  // "vue/object-curly-newline": "off",
3307
3158
  "vue/object-curly-spacing": [stylisticEnforcement, "always"],
3308
- "vue/object-property-newline": [
3309
- stylisticEnforcement,
3310
- { allowMultiplePropertiesPerLine: true },
3311
- ],
3159
+ "vue/object-property-newline": [stylisticEnforcement, { allowMultiplePropertiesPerLine: true }],
3312
3160
  "vue/operator-linebreak": [stylisticEnforcement, "before"],
3313
3161
  "vue/padding-line-between-blocks": [stylisticEnforcement, "always"],
3314
3162
  "vue/quote-props": [stylisticEnforcement, "consistent-as-needed"],
@@ -3323,10 +3171,7 @@ async function vue(options) {
3323
3171
  async function yaml(options) {
3324
3172
  const { files, overrides, stylistic } = options;
3325
3173
  const { indent = 2, quotes = "single" } = typeof stylistic === "boolean" ? {} : stylistic;
3326
- const [pluginYaml, parserYaml] = (await loadPackages([
3327
- "eslint-plugin-yml",
3328
- "yaml-eslint-parser",
3329
- ]));
3174
+ const [pluginYaml, parserYaml] = (await loadPackages(["eslint-plugin-yml", "yaml-eslint-parser"]));
3330
3175
  const stylisticEnforcement = stylistic === false ? "off" : "error";
3331
3176
  return [
3332
3177
  {
@@ -3359,10 +3204,7 @@ async function yaml(options) {
3359
3204
  "yaml/indent": [stylisticEnforcement, indent === "tab" ? 2 : indent],
3360
3205
  "yaml/key-spacing": stylisticEnforcement,
3361
3206
  "yaml/no-tab-indent": stylisticEnforcement,
3362
- "yaml/quotes": [
3363
- stylisticEnforcement,
3364
- { avoidEscape: true, prefer: quotes },
3365
- ],
3207
+ "yaml/quotes": [stylisticEnforcement, { avoidEscape: true, prefer: quotes }],
3366
3208
  "yaml/spaced-comment": stylisticEnforcement,
3367
3209
  ...overrides,
3368
3210
  },
@@ -3517,8 +3359,7 @@ async function sonar(options) {
3517
3359
  "sonar/prefer-object-literal": "error",
3518
3360
  "sonar/prefer-single-boolean-return": "error",
3519
3361
  "sonar/prefer-while": "error",
3520
- ...(functionalEnforcement === "recommended" ||
3521
- functionalEnforcement === "strict"
3362
+ ...(functionalEnforcement === "recommended" || functionalEnforcement === "strict"
3522
3363
  ? {
3523
3364
  "sonar/elseif-without-else": "error",
3524
3365
  }
@@ -3548,11 +3389,7 @@ const defaultPluginRenaming = {
3548
3389
  * @returns {Promise<FlatConfigItem[]>} The merged ESLint configurations.
3549
3390
  */
3550
3391
  async function rsEslint(options, ...userConfigs) {
3551
- const [FlatConfigComposer] = await loadPackages([
3552
- "eslint-flat-config-utils",
3553
- ]).then(([a]) => [
3554
- a.FlatConfigComposer,
3555
- ]);
3392
+ const [FlatConfigComposer] = await loadPackages(["eslint-flat-config-utils"]).then(([a]) => [a.FlatConfigComposer]);
3556
3393
  const { autoRenamePlugins = true, componentExts = [], isInEditor = !Boolean(process.env["CI"]) &&
3557
3394
  (Boolean(process.env["VSCODE_PID"]) ||
3558
3395
  Boolean(process.env["VSCODE_CWD"]) ||
@@ -3579,9 +3416,7 @@ async function rsEslint(options, ...userConfigs) {
3579
3416
  const { filesTypeAware, parserOptions, useDefaultDefaultProject, ...typeScriptSubOptions } = resolveSubOptions(options, "typescript");
3580
3417
  const projectServiceUserConfig = {
3581
3418
  defaultProject: "./tsconfig.json",
3582
- ...(typeof parserOptions?.projectService === "object"
3583
- ? parserOptions.projectService
3584
- : undefined),
3419
+ ...(typeof parserOptions?.projectService === "object" ? parserOptions.projectService : undefined),
3585
3420
  };
3586
3421
  const typescriptConfigOptions = {
3587
3422
  ...typeScriptSubOptions,
@@ -3707,8 +3542,7 @@ async function rsEslint(options, ...userConfigs) {
3707
3542
  }
3708
3543
  if (markdownOptions !== false) {
3709
3544
  m_configs.push(markdown({
3710
- enableTypeRequiredRules: !(markdownOptions === true ||
3711
- markdownOptions.enableTypeRequiredRules === false),
3545
+ enableTypeRequiredRules: !(markdownOptions === true || markdownOptions.enableTypeRequiredRules === false),
3712
3546
  files: [GLOB_MARKDOWN],
3713
3547
  componentExts,
3714
3548
  overrides: getOverrides(options, "markdown"),
@@ -3725,12 +3559,10 @@ async function rsEslint(options, ...userConfigs) {
3725
3559
  if (autoRenamePlugins) {
3726
3560
  m_composer = m_composer.renamePlugins(defaultPluginRenaming);
3727
3561
  }
3728
- return m_composer;
3562
+ return m_composer.toConfigs();
3729
3563
  }
3730
3564
  function resolveSubOptions(options, key) {
3731
- return (typeof options[key] === "boolean" || typeof options[key] === "string"
3732
- ? {}
3733
- : (options[key] ?? {}));
3565
+ return (typeof options[key] === "boolean" || typeof options[key] === "string" ? {} : (options[key] ?? {}));
3734
3566
  }
3735
3567
  function getOverrides(options, key) {
3736
3568
  const sub = resolveSubOptions(options, key);
package/dist/index.d.cts CHANGED
@@ -7,7 +7,6 @@ import { ESLint, Linter } from "eslint";
7
7
  import { Options as VueBlocksOptions } from "eslint-processor-vue-blocks";
8
8
  import { Options as PrettierOptions } from "prettier";
9
9
  import { SettingsVueI18nLocaleDir } from "../typings/eslint-plugin-vue-i18n";
10
- import { FlatConfigComposer } from "eslint-flat-config-utils";
11
10
  declare module "eslint" {
12
11
  namespace Linter {
13
12
  interface RulesRecord extends RuleOptions {
@@ -13707,7 +13706,7 @@ declare const defaultPluginRenaming: {
13707
13706
  * @param {Awaitable<FlatConfigItem | FlatConfigItem[]>[]} userConfigs - The user configurations to be merged with the generated configurations.
13708
13707
  * @returns {Promise<FlatConfigItem[]>} The merged ESLint configurations.
13709
13708
  */
13710
- declare function rsEslint(options: OptionsConfig, ...userConfigs: ReadonlyArray<Awaitable<FlatConfigItem | FlatConfigItem[]>>): Promise<FlatConfigComposer<FlatConfigItem>>;
13709
+ declare function rsEslint(options: OptionsConfig, ...userConfigs: ReadonlyArray<Awaitable<FlatConfigItem | FlatConfigItem[]>>): Promise<FlatConfigItem[]>;
13711
13710
  type ResolvedOptions<T> = T extends boolean ? never : T extends string ? never : NonNullable<T>;
13712
13711
  declare function resolveSubOptions<K extends keyof OptionsConfig>(options: Readonly<OptionsConfig>, key: K): ResolvedOptions<OptionsConfig[K]>;
13713
13712
  declare function getOverrides<K extends keyof OptionsConfig>(options: Readonly<OptionsConfig>, key: K): (Partial<Record<string, import("@typescript-eslint/utils/ts-eslint").SharedConfig.RuleEntry>> & RuleOptions) | undefined;
package/dist/index.d.mts CHANGED
@@ -7,7 +7,6 @@ import { ESLint, Linter } from "eslint";
7
7
  import { Options as VueBlocksOptions } from "eslint-processor-vue-blocks";
8
8
  import { Options as PrettierOptions } from "prettier";
9
9
  import { SettingsVueI18nLocaleDir } from "../typings/eslint-plugin-vue-i18n";
10
- import { FlatConfigComposer } from "eslint-flat-config-utils";
11
10
  declare module "eslint" {
12
11
  namespace Linter {
13
12
  interface RulesRecord extends RuleOptions {
@@ -13707,7 +13706,7 @@ declare const defaultPluginRenaming: {
13707
13706
  * @param {Awaitable<FlatConfigItem | FlatConfigItem[]>[]} userConfigs - The user configurations to be merged with the generated configurations.
13708
13707
  * @returns {Promise<FlatConfigItem[]>} The merged ESLint configurations.
13709
13708
  */
13710
- declare function rsEslint(options: OptionsConfig, ...userConfigs: ReadonlyArray<Awaitable<FlatConfigItem | FlatConfigItem[]>>): Promise<FlatConfigComposer<FlatConfigItem>>;
13709
+ declare function rsEslint(options: OptionsConfig, ...userConfigs: ReadonlyArray<Awaitable<FlatConfigItem | FlatConfigItem[]>>): Promise<FlatConfigItem[]>;
13711
13710
  type ResolvedOptions<T> = T extends boolean ? never : T extends string ? never : NonNullable<T>;
13712
13711
  declare function resolveSubOptions<K extends keyof OptionsConfig>(options: Readonly<OptionsConfig>, key: K): ResolvedOptions<OptionsConfig[K]>;
13713
13712
  declare function getOverrides<K extends keyof OptionsConfig>(options: Readonly<OptionsConfig>, key: K): (Partial<Record<string, import("@typescript-eslint/utils/ts-eslint").SharedConfig.RuleEntry>> & RuleOptions) | undefined;
package/dist/index.mjs CHANGED
@@ -81,9 +81,7 @@ async function installPackages(packages) {
81
81
  /* eslint-enable functional/no-loop-statements */
82
82
 
83
83
  async function comments() {
84
- const [pluginComments] = (await loadPackages([
85
- "eslint-plugin-eslint-comments",
86
- ]));
84
+ const [pluginComments] = (await loadPackages(["eslint-plugin-eslint-comments"]));
87
85
  return [
88
86
  {
89
87
  name: "rs:comments",
@@ -205,14 +203,13 @@ async function formatters(opts, stylistic) {
205
203
  slidev: isPackageExists("@slidev/cli"),
206
204
  }
207
205
  : opts;
208
- if (options.slidev !== false &&
209
- options.slidev !== undefined &&
210
- options.markdown !== true) {
206
+ if (options.slidev !== false && options.slidev !== undefined && options.markdown !== true) {
211
207
  throw new Error("`slidev` option only works when `markdown` is enabled with `prettier`");
212
208
  }
213
209
  const { indent, quotes, semi } = stylistic;
214
210
  const prettierOptions = Object.assign({
215
211
  endOfLine: "lf",
212
+ printWidth: 120,
216
213
  semi: semi ?? true,
217
214
  singleQuote: quotes === "single",
218
215
  tabWidth: typeof indent === "number" ? indent : 2,
@@ -684,7 +681,6 @@ async function formatters(opts, stylistic) {
684
681
  "format/prettier": [
685
682
  "error",
686
683
  {
687
- printWidth: 120,
688
684
  ...prettierOptions,
689
685
  embeddedLanguageFormatting: "off",
690
686
  parser: "markdown",
@@ -704,7 +700,6 @@ async function formatters(opts, stylistic) {
704
700
  "format/prettier": [
705
701
  "error",
706
702
  {
707
- printWidth: 120,
708
703
  ...prettierOptions,
709
704
  embeddedLanguageFormatting: "off",
710
705
  parser: "slidev",
@@ -741,9 +736,7 @@ async function functional(options) {
741
736
  const { mode, overrides, stylistic, filesTypeAware, functionalEnforcement, ignoreNamePattern,
742
737
  // ignoreTypePattern,
743
738
  } = options;
744
- const [pluginFunctional] = (await loadPackages([
745
- "eslint-plugin-functional",
746
- ]));
739
+ const [pluginFunctional] = (await loadPackages(["eslint-plugin-functional"]));
747
740
  const strictRules = {
748
741
  "functional/functional-parameters": "error",
749
742
  "functional/no-throw-statements": "error",
@@ -940,8 +933,7 @@ async function functional(options) {
940
933
  ...recommendedRules["functional/prefer-immutable-types"][1],
941
934
  overrides: [
942
935
  {
943
- ...recommendedRules["functional/prefer-immutable-types"][1]
944
- .overrides[0],
936
+ ...recommendedRules["functional/prefer-immutable-types"][1].overrides[0],
945
937
  specifiers: [
946
938
  {
947
939
  from: "file",
@@ -954,10 +946,7 @@ async function functional(options) {
954
946
  };
955
947
  const noneLibraryRules = {
956
948
  "functional/prefer-immutable-types": liteRules["functional/prefer-immutable-types"],
957
- "functional/type-declaration-immutability": [
958
- "warn",
959
- liteRules["functional/type-declaration-immutability"][1],
960
- ],
949
+ "functional/type-declaration-immutability": ["warn", liteRules["functional/type-declaration-immutability"][1]],
961
950
  };
962
951
  return [
963
952
  {
@@ -1017,10 +1006,7 @@ async function ignores(options) {
1017
1006
  return null;
1018
1007
  });
1019
1008
  }));
1020
- return [
1021
- ignoreConfig,
1022
- ...ignoreFileConfigs.filter((v) => v !== null),
1023
- ];
1009
+ return [ignoreConfig, ...ignoreFileConfigs.filter((v) => v !== null)];
1024
1010
  }
1025
1011
 
1026
1012
  async function imports(options) {
@@ -1038,10 +1024,7 @@ async function imports(options) {
1038
1024
  import: pluginImport,
1039
1025
  },
1040
1026
  settings: {
1041
- "import-x/external-module-folders": [
1042
- "node_modules",
1043
- "node_modules/@types",
1044
- ],
1027
+ "import-x/external-module-folders": ["node_modules", "node_modules/@types"],
1045
1028
  "import-x/internal-regex": "^(?:#|(?:@|~)\\/).*",
1046
1029
  "import-x/extensions": [".ts", ".tsx", ".js", ".jsx"],
1047
1030
  "import-x/parsers": {
@@ -1155,10 +1138,7 @@ async function imports(options) {
1155
1138
  "import/no-webpack-loader-syntax": "error",
1156
1139
  // "import/prefer-default-export": "off",
1157
1140
  // "import/unambiguous": "off",
1158
- "import/newline-after-import": [
1159
- stylistic === false ? "off" : "error",
1160
- { count: 1 },
1161
- ],
1141
+ "import/newline-after-import": [stylistic === false ? "off" : "error", { count: 1 }],
1162
1142
  "import/order": [
1163
1143
  stylistic === false ? "off" : "error",
1164
1144
  {
@@ -1166,14 +1146,7 @@ async function imports(options) {
1166
1146
  caseInsensitive: false,
1167
1147
  order: "asc",
1168
1148
  },
1169
- groups: [
1170
- "builtin",
1171
- "external",
1172
- "internal",
1173
- "parent",
1174
- "sibling",
1175
- "index",
1176
- ],
1149
+ groups: ["builtin", "external", "internal", "parent", "sibling", "index"],
1177
1150
  "newlines-between": "always",
1178
1151
  },
1179
1152
  ],
@@ -1518,11 +1491,7 @@ function javascript(options) {
1518
1491
  "no-useless-return": "error",
1519
1492
  "no-var": "error",
1520
1493
  "no-with": "error",
1521
- "object-shorthand": [
1522
- "error",
1523
- "always",
1524
- { avoidQuotes: true, ignoreConstructors: false },
1525
- ],
1494
+ "object-shorthand": ["error", "always", { avoidQuotes: true, ignoreConstructors: false }],
1526
1495
  "one-var": [
1527
1496
  "error",
1528
1497
  {
@@ -1532,14 +1501,8 @@ function javascript(options) {
1532
1501
  },
1533
1502
  ],
1534
1503
  "operator-assignment": ["error", "always"],
1535
- "prefer-arrow-callback": [
1536
- "error",
1537
- { allowNamedFunctions: false, allowUnboundThis: true },
1538
- ],
1539
- "prefer-const": [
1540
- "error",
1541
- { destructuring: "all", ignoreReadBeforeAssign: true },
1542
- ],
1504
+ "prefer-arrow-callback": ["error", { allowNamedFunctions: false, allowUnboundThis: true }],
1505
+ "prefer-const": ["error", { destructuring: "all", ignoreReadBeforeAssign: true }],
1543
1506
  "prefer-destructuring": [
1544
1507
  "error",
1545
1508
  {
@@ -1575,10 +1538,7 @@ function javascript(options) {
1575
1538
  strict: ["error", "never"],
1576
1539
  "symbol-description": "error",
1577
1540
  "unicode-bom": ["error", "never"],
1578
- "use-isnan": [
1579
- "error",
1580
- { enforceForIndexOf: true, enforceForSwitchCase: true },
1581
- ],
1541
+ "use-isnan": ["error", { enforceForIndexOf: true, enforceForSwitchCase: true }],
1582
1542
  "valid-typeof": ["error", { requireStringLiterals: true }],
1583
1543
  "vars-on-top": "error",
1584
1544
  yoda: ["error", "never"],
@@ -1623,13 +1583,7 @@ async function jsdoc(options) {
1623
1583
  "jsdoc/no-bad-blocks": [
1624
1584
  "error",
1625
1585
  {
1626
- ignore: [
1627
- "ts-check",
1628
- "ts-expect-error",
1629
- "ts-ignore",
1630
- "ts-nocheck",
1631
- "vue-ignore",
1632
- ],
1586
+ ignore: ["ts-check", "ts-expect-error", "ts-ignore", "ts-nocheck", "vue-ignore"],
1633
1587
  },
1634
1588
  ],
1635
1589
  "jsdoc/no-defaults": "warn",
@@ -1686,10 +1640,7 @@ async function jsdoc(options) {
1686
1640
  async function jsonc(options) {
1687
1641
  const { files, overrides, stylistic } = options;
1688
1642
  const { indent = 2 } = typeof stylistic === "boolean" ? {} : stylistic;
1689
- const [pluginJsonc, parserJsonc] = (await loadPackages([
1690
- "eslint-plugin-jsonc",
1691
- "jsonc-eslint-parser",
1692
- ]));
1643
+ const [pluginJsonc, parserJsonc] = (await loadPackages(["eslint-plugin-jsonc", "jsonc-eslint-parser"]));
1693
1644
  const stylisticEnforcement = stylistic === false ? "off" : "error";
1694
1645
  return [
1695
1646
  {
@@ -1735,19 +1686,10 @@ async function jsonc(options) {
1735
1686
  "jsonc/comma-dangle": [stylisticEnforcement, "never"],
1736
1687
  "jsonc/comma-style": [stylisticEnforcement, "last"],
1737
1688
  "jsonc/indent": [stylisticEnforcement, indent],
1738
- "jsonc/key-spacing": [
1739
- stylisticEnforcement,
1740
- { afterColon: true, beforeColon: false },
1741
- ],
1742
- "jsonc/object-curly-newline": [
1743
- stylisticEnforcement,
1744
- { consistent: true, multiline: true },
1745
- ],
1689
+ "jsonc/key-spacing": [stylisticEnforcement, { afterColon: true, beforeColon: false }],
1690
+ "jsonc/object-curly-newline": [stylisticEnforcement, { consistent: true, multiline: true }],
1746
1691
  "jsonc/object-curly-spacing": [stylisticEnforcement, "always"],
1747
- "jsonc/object-property-newline": [
1748
- stylisticEnforcement,
1749
- { allowMultiplePropertiesPerLine: true },
1750
- ],
1692
+ "jsonc/object-property-newline": [stylisticEnforcement, { allowMultiplePropertiesPerLine: true }],
1751
1693
  "jsonc/quote-props": stylisticEnforcement,
1752
1694
  "jsonc/quotes": stylisticEnforcement,
1753
1695
  ...overrides,
@@ -1795,15 +1737,10 @@ async function markdown(options) {
1795
1737
  },
1796
1738
  {
1797
1739
  name: "rs:markdown:code",
1798
- files: [
1799
- GLOB_MARKDOWN_CODE,
1800
- ...componentExts.map((ext) => `${GLOB_MARKDOWN}/*.${ext}`),
1801
- ],
1740
+ files: [GLOB_MARKDOWN_CODE, ...componentExts.map((ext) => `${GLOB_MARKDOWN}/*.${ext}`)],
1802
1741
  languageOptions: {
1803
1742
  parserOptions: {
1804
- ...(enableTypeRequiredRules
1805
- ? undefined
1806
- : { project: false, projectService: false, program: null }),
1743
+ ...(enableTypeRequiredRules ? undefined : { project: false, projectService: false, program: null }),
1807
1744
  ecmaFeatures: {
1808
1745
  impliedStrict: true,
1809
1746
  },
@@ -2044,14 +1981,7 @@ function sortTsconfig() {
2044
1981
  "jsonc/sort-keys": [
2045
1982
  "error",
2046
1983
  {
2047
- order: [
2048
- "extends",
2049
- "compilerOptions",
2050
- "references",
2051
- "files",
2052
- "include",
2053
- "exclude",
2054
- ],
1984
+ order: ["extends", "compilerOptions", "references", "files", "include", "exclude"],
2055
1985
  pathPattern: "^$",
2056
1986
  },
2057
1987
  {
@@ -2169,9 +2099,7 @@ const StylisticConfigDefaults = {
2169
2099
  };
2170
2100
  async function stylistic(options) {
2171
2101
  const { stylistic: { indent, jsx, quotes, semi }, overrides, typescript, } = options;
2172
- const [pluginStylistic] = (await loadPackages([
2173
- "@stylistic/eslint-plugin",
2174
- ]));
2102
+ const [pluginStylistic] = (await loadPackages(["@stylistic/eslint-plugin"]));
2175
2103
  const config = pluginStylistic.configs.customize({
2176
2104
  flat: true,
2177
2105
  indent,
@@ -2238,10 +2166,7 @@ async function stylistic(options) {
2238
2166
  },
2239
2167
  ],
2240
2168
  "style/indent-binary-ops": "error",
2241
- "style/key-spacing": [
2242
- "error",
2243
- { beforeColon: false, afterColon: true },
2244
- ],
2169
+ "style/key-spacing": ["error", { beforeColon: false, afterColon: true }],
2245
2170
  "style/keyword-spacing": ["error", { before: true, after: true }],
2246
2171
  "style/linebreak-style": ["error", "unix"],
2247
2172
  "style/lines-around-comment": [
@@ -2289,15 +2214,8 @@ async function stylistic(options) {
2289
2214
  "style/max-statements-per-line": ["error", { max: 1 }],
2290
2215
  "style/multiline-ternary": ["error", "always-multiline"],
2291
2216
  "style/new-parens": "error",
2292
- "style/newline-per-chained-call": [
2293
- "error",
2294
- { ignoreChainWithDepth: 2 },
2295
- ],
2296
- "style/no-extra-parens": [
2297
- "error",
2298
- "all",
2299
- { nestedBinaryExpressions: false },
2300
- ],
2217
+ "style/newline-per-chained-call": ["error", { ignoreChainWithDepth: 2 }],
2218
+ "style/no-extra-parens": ["error", "all", { nestedBinaryExpressions: false }],
2301
2219
  "style/no-extra-semi": "error",
2302
2220
  "style/no-floating-decimal": "error",
2303
2221
  "style/no-mixed-operators": [
@@ -2319,11 +2237,7 @@ async function stylistic(options) {
2319
2237
  "style/no-tabs": "error",
2320
2238
  "style/no-trailing-spaces": "error",
2321
2239
  "style/no-whitespace-before-property": "error",
2322
- "style/nonblock-statement-body-position": [
2323
- "error",
2324
- "beside",
2325
- { overrides: {} },
2326
- ],
2240
+ "style/nonblock-statement-body-position": ["error", "beside", { overrides: {} }],
2327
2241
  "style/object-curly-newline": [
2328
2242
  "error",
2329
2243
  {
@@ -2340,10 +2254,7 @@ async function stylistic(options) {
2340
2254
  },
2341
2255
  ],
2342
2256
  "style/object-curly-spacing": ["error", "always"],
2343
- "style/object-property-newline": [
2344
- "error",
2345
- { allowAllPropertiesOnSameLine: true },
2346
- ],
2257
+ "style/object-property-newline": ["error", { allowAllPropertiesOnSameLine: true }],
2347
2258
  "style/one-var-declaration-per-line": ["error", "always"],
2348
2259
  "style/operator-linebreak": [
2349
2260
  "error",
@@ -2367,11 +2278,7 @@ async function stylistic(options) {
2367
2278
  },
2368
2279
  ],
2369
2280
  "style/quote-props": ["error", "consistent-as-needed"],
2370
- "style/quotes": [
2371
- "error",
2372
- quotes,
2373
- { avoidEscape: true, allowTemplateLiterals: true },
2374
- ],
2281
+ "style/quotes": ["error", quotes, { avoidEscape: true, allowTemplateLiterals: true }],
2375
2282
  "style/rest-spread-spacing": ["error", "never"],
2376
2283
  "style/semi-spacing": ["error", { before: false, after: true }],
2377
2284
  "style/semi-style": ["error", "last"],
@@ -2406,11 +2313,7 @@ async function stylistic(options) {
2406
2313
  "style/switch-colon-spacing": ["error", { after: true, before: false }],
2407
2314
  "style/template-curly-spacing": ["error", "never"],
2408
2315
  "style/template-tag-spacing": ["error", "never"],
2409
- "style/wrap-iife": [
2410
- "error",
2411
- "inside",
2412
- { functionPrototypeMethods: true },
2413
- ],
2316
+ "style/wrap-iife": ["error", "inside", { functionPrototypeMethods: true }],
2414
2317
  "style/yield-star-spacing": ["error", "after"],
2415
2318
  ...(typescript
2416
2319
  ? {
@@ -2463,10 +2366,7 @@ async function test(options) {
2463
2366
  "regexp/no-super-linear-backtracking": "off",
2464
2367
  "sonar/no-duplicate-string": "off",
2465
2368
  "sonar/no-identical-functions": "off",
2466
- "test/consistent-test-it": [
2467
- "error",
2468
- { fn: "it", withinDescribe: "it" },
2469
- ],
2369
+ "test/consistent-test-it": ["error", { fn: "it", withinDescribe: "it" }],
2470
2370
  "test/no-identical-title": "error",
2471
2371
  "test/no-import-node-test": "error",
2472
2372
  "test/no-only-tests": "error",
@@ -2492,10 +2392,7 @@ async function test(options) {
2492
2392
  async function toml(options) {
2493
2393
  const { files, overrides, stylistic } = options;
2494
2394
  const { indent = 2 } = typeof stylistic === "boolean" ? {} : stylistic;
2495
- const [pluginToml, parserToml] = (await loadPackages([
2496
- "eslint-plugin-toml",
2497
- "toml-eslint-parser",
2498
- ]));
2395
+ const [pluginToml, parserToml] = (await loadPackages(["eslint-plugin-toml", "toml-eslint-parser"]));
2499
2396
  const stylisticEnforcement = stylistic === false ? "off" : "error";
2500
2397
  return [
2501
2398
  {
@@ -2581,10 +2478,7 @@ async function typescript(options) {
2581
2478
  "consistent-return": "off", // Don't turn on ts version
2582
2479
  "import/named": "off",
2583
2480
  "no-undef": "off",
2584
- "ts/array-type": [
2585
- "error",
2586
- { default: "array-simple", readonly: "generic" },
2587
- ],
2481
+ "ts/array-type": ["error", { default: "array-simple", readonly: "generic" }],
2588
2482
  "ts/await-thenable": "error",
2589
2483
  "ts/ban-ts-comment": ["error", { minimumDescriptionLength: 10 }],
2590
2484
  "ts/explicit-function-return-type": [
@@ -2596,16 +2490,10 @@ async function typescript(options) {
2596
2490
  allowTypedFunctionExpressions: true,
2597
2491
  },
2598
2492
  ],
2599
- "ts/explicit-member-accessibility": [
2600
- "error",
2601
- { accessibility: "explicit" },
2602
- ],
2493
+ "ts/explicit-member-accessibility": ["error", { accessibility: "explicit" }],
2603
2494
  "ts/no-array-delete": "error",
2604
2495
  "ts/no-base-to-string": "error",
2605
- "ts/no-confusing-void-expression": [
2606
- "error",
2607
- { ignoreArrowShorthand: false, ignoreVoidOperator: true },
2608
- ],
2496
+ "ts/no-confusing-void-expression": ["error", { ignoreArrowShorthand: false, ignoreVoidOperator: true }],
2609
2497
  "ts/no-duplicate-enum-values": "error",
2610
2498
  "ts/no-duplicate-type-constituents": "error",
2611
2499
  "ts/no-dynamic-delete": "error",
@@ -2628,10 +2516,7 @@ async function typescript(options) {
2628
2516
  "ts/no-redundant-type-constituents": "error",
2629
2517
  "ts/no-this-alias": "error",
2630
2518
  "ts/no-unnecessary-boolean-literal-compare": "error",
2631
- "ts/no-unnecessary-condition": [
2632
- "error",
2633
- { allowConstantLoopConditions: true },
2634
- ],
2519
+ "ts/no-unnecessary-condition": ["error", { allowConstantLoopConditions: true }],
2635
2520
  "ts/no-unnecessary-type-arguments": "error",
2636
2521
  "ts/no-unnecessary-type-assertion": "error",
2637
2522
  "ts/no-unnecessary-type-constraint": "error",
@@ -2702,10 +2587,7 @@ async function typescript(options) {
2702
2587
  ],
2703
2588
  "ts/switch-exhaustiveness-check": "error",
2704
2589
  "ts/unbound-method": ["error", { ignoreStatic: true }],
2705
- "ts/unified-signatures": [
2706
- "error",
2707
- { ignoreDifferentlyNamedParameters: true },
2708
- ],
2590
+ "ts/unified-signatures": ["error", { ignoreDifferentlyNamedParameters: true }],
2709
2591
  "ts/use-unknown-in-catch-callback-variable": "error",
2710
2592
  "no-use-before-define": "off",
2711
2593
  "ts/no-use-before-define": [
@@ -2747,10 +2629,7 @@ async function typescript(options) {
2747
2629
  "no-throw-literal": "off",
2748
2630
  "ts/only-throw-error": "error",
2749
2631
  "dot-notation": "off",
2750
- "ts/dot-notation": [
2751
- "error",
2752
- { allowIndexSignaturePropertyAccess: true },
2753
- ],
2632
+ "ts/dot-notation": ["error", { allowIndexSignaturePropertyAccess: true }],
2754
2633
  "ts/consistent-indexed-object-style": "error",
2755
2634
  "ts/consistent-type-definitions": ["error", "type"],
2756
2635
  "class-methods-use-this": "off",
@@ -2878,12 +2757,7 @@ async function typescript(options) {
2878
2757
  trailingUnderscore: "forbid",
2879
2758
  },
2880
2759
  {
2881
- selector: [
2882
- "accessor",
2883
- "classMethod",
2884
- "typeMethod",
2885
- "typeProperty",
2886
- ],
2760
+ selector: ["accessor", "classMethod", "typeMethod", "typeProperty"],
2887
2761
  format: ["camelCase", "PascalCase", "UPPER_CASE"],
2888
2762
  leadingUnderscore: "allow",
2889
2763
  trailingUnderscore: "forbid",
@@ -2913,8 +2787,7 @@ async function typescript(options) {
2913
2787
  name: "rs:typescript:rules-non-type-aware",
2914
2788
  files,
2915
2789
  ignores: filesTypeAware,
2916
- rules: ((pluginTs.configs?.["disable-type-checked"])
2917
- .rules ?? {}),
2790
+ rules: ((pluginTs.configs?.["disable-type-checked"]).rules ?? {}),
2918
2791
  },
2919
2792
  {
2920
2793
  name: "rs:typescript:tests-overrides",
@@ -3089,10 +2962,10 @@ async function unocss(options) {
3089
2962
 
3090
2963
  /* eslint-enable ts/naming-convention */
3091
2964
  async function vue(options) {
3092
- const { files, i18n, overrides, parserOptions, stylistic, typescript, vueVersion, } = options;
2965
+ const { files, i18n, overrides, parserOptions, stylistic, typescript, vueVersion } = options;
3093
2966
  const sfcBlocks = options.sfcBlocks === true ? {} : options.sfcBlocks;
3094
2967
  const { indent = 2 } = typeof stylistic === "boolean" ? {} : stylistic;
3095
- const [pluginVue, pluginVueI18n, parserVue, processorVueBlocks, { mergeProcessors },] = (await loadPackages([
2968
+ const [pluginVue, pluginVueI18n, parserVue, processorVueBlocks, { mergeProcessors }] = (await loadPackages([
3096
2969
  "eslint-plugin-vue",
3097
2970
  "@intlify/eslint-plugin-vue-i18n",
3098
2971
  "vue-eslint-parser",
@@ -3191,12 +3064,7 @@ async function vue(options) {
3191
3064
  "vue/define-macros-order": [
3192
3065
  "error",
3193
3066
  {
3194
- order: [
3195
- "defineOptions",
3196
- "defineProps",
3197
- "defineEmits",
3198
- "defineSlots",
3199
- ],
3067
+ order: ["defineOptions", "defineProps", "defineEmits", "defineSlots"],
3200
3068
  },
3201
3069
  ],
3202
3070
  "vue/dot-location": ["error", "property"],
@@ -3210,12 +3078,7 @@ async function vue(options) {
3210
3078
  "vue/no-empty-pattern": "error",
3211
3079
  "vue/no-irregular-whitespace": "error",
3212
3080
  "vue/no-loss-of-precision": "error",
3213
- "vue/no-restricted-syntax": [
3214
- "error",
3215
- "DebuggerStatement",
3216
- "LabeledStatement",
3217
- "WithStatement",
3218
- ],
3081
+ "vue/no-restricted-syntax": ["error", "DebuggerStatement", "LabeledStatement", "WithStatement"],
3219
3082
  "vue/no-restricted-v-bind": ["error", "/^v-/"],
3220
3083
  // "vue/no-setup-props-reactivity-loss": "off",
3221
3084
  "vue/no-sparse-arrays": "error",
@@ -3242,10 +3105,7 @@ async function vue(options) {
3242
3105
  "vue-i18n/no-raw-text": i18n === false ? "off" : "warn",
3243
3106
  "vue-i18n/no-v-html": i18n === false ? "off" : "error",
3244
3107
  "vue/array-bracket-spacing": [stylisticEnforcement, "never"],
3245
- "vue/arrow-spacing": [
3246
- stylisticEnforcement,
3247
- { after: true, before: true },
3248
- ],
3108
+ "vue/arrow-spacing": [stylisticEnforcement, { after: true, before: true }],
3249
3109
  "vue/block-spacing": [stylisticEnforcement, "always"],
3250
3110
  "vue/block-tag-newline": [
3251
3111
  stylisticEnforcement,
@@ -3261,10 +3121,7 @@ async function vue(options) {
3261
3121
  { allowSingleLine: true },
3262
3122
  ],
3263
3123
  "vue/comma-dangle": [stylisticEnforcement, "always-multiline"],
3264
- "vue/comma-spacing": [
3265
- stylisticEnforcement,
3266
- { after: true, before: false },
3267
- ],
3124
+ "vue/comma-spacing": [stylisticEnforcement, { after: true, before: false }],
3268
3125
  "vue/comma-style": [stylisticEnforcement, "last"],
3269
3126
  "vue/html-comment-content-spacing": [
3270
3127
  stylisticEnforcement,
@@ -3273,20 +3130,11 @@ async function vue(options) {
3273
3130
  exceptions: ["-"],
3274
3131
  },
3275
3132
  ],
3276
- "vue/key-spacing": [
3277
- stylisticEnforcement,
3278
- { afterColon: true, beforeColon: false },
3279
- ],
3280
- "vue/keyword-spacing": [
3281
- stylisticEnforcement,
3282
- { after: true, before: true },
3283
- ],
3133
+ "vue/key-spacing": [stylisticEnforcement, { afterColon: true, beforeColon: false }],
3134
+ "vue/keyword-spacing": [stylisticEnforcement, { after: true, before: true }],
3284
3135
  // "vue/object-curly-newline": "off",
3285
3136
  "vue/object-curly-spacing": [stylisticEnforcement, "always"],
3286
- "vue/object-property-newline": [
3287
- stylisticEnforcement,
3288
- { allowMultiplePropertiesPerLine: true },
3289
- ],
3137
+ "vue/object-property-newline": [stylisticEnforcement, { allowMultiplePropertiesPerLine: true }],
3290
3138
  "vue/operator-linebreak": [stylisticEnforcement, "before"],
3291
3139
  "vue/padding-line-between-blocks": [stylisticEnforcement, "always"],
3292
3140
  "vue/quote-props": [stylisticEnforcement, "consistent-as-needed"],
@@ -3301,10 +3149,7 @@ async function vue(options) {
3301
3149
  async function yaml(options) {
3302
3150
  const { files, overrides, stylistic } = options;
3303
3151
  const { indent = 2, quotes = "single" } = typeof stylistic === "boolean" ? {} : stylistic;
3304
- const [pluginYaml, parserYaml] = (await loadPackages([
3305
- "eslint-plugin-yml",
3306
- "yaml-eslint-parser",
3307
- ]));
3152
+ const [pluginYaml, parserYaml] = (await loadPackages(["eslint-plugin-yml", "yaml-eslint-parser"]));
3308
3153
  const stylisticEnforcement = stylistic === false ? "off" : "error";
3309
3154
  return [
3310
3155
  {
@@ -3337,10 +3182,7 @@ async function yaml(options) {
3337
3182
  "yaml/indent": [stylisticEnforcement, indent === "tab" ? 2 : indent],
3338
3183
  "yaml/key-spacing": stylisticEnforcement,
3339
3184
  "yaml/no-tab-indent": stylisticEnforcement,
3340
- "yaml/quotes": [
3341
- stylisticEnforcement,
3342
- { avoidEscape: true, prefer: quotes },
3343
- ],
3185
+ "yaml/quotes": [stylisticEnforcement, { avoidEscape: true, prefer: quotes }],
3344
3186
  "yaml/spaced-comment": stylisticEnforcement,
3345
3187
  ...overrides,
3346
3188
  },
@@ -3495,8 +3337,7 @@ async function sonar(options) {
3495
3337
  "sonar/prefer-object-literal": "error",
3496
3338
  "sonar/prefer-single-boolean-return": "error",
3497
3339
  "sonar/prefer-while": "error",
3498
- ...(functionalEnforcement === "recommended" ||
3499
- functionalEnforcement === "strict"
3340
+ ...(functionalEnforcement === "recommended" || functionalEnforcement === "strict"
3500
3341
  ? {
3501
3342
  "sonar/elseif-without-else": "error",
3502
3343
  }
@@ -3526,11 +3367,7 @@ const defaultPluginRenaming = {
3526
3367
  * @returns {Promise<FlatConfigItem[]>} The merged ESLint configurations.
3527
3368
  */
3528
3369
  async function rsEslint(options, ...userConfigs) {
3529
- const [FlatConfigComposer] = await loadPackages([
3530
- "eslint-flat-config-utils",
3531
- ]).then(([a]) => [
3532
- a.FlatConfigComposer,
3533
- ]);
3370
+ const [FlatConfigComposer] = await loadPackages(["eslint-flat-config-utils"]).then(([a]) => [a.FlatConfigComposer]);
3534
3371
  const { autoRenamePlugins = true, componentExts = [], isInEditor = !Boolean(process.env["CI"]) &&
3535
3372
  (Boolean(process.env["VSCODE_PID"]) ||
3536
3373
  Boolean(process.env["VSCODE_CWD"]) ||
@@ -3557,9 +3394,7 @@ async function rsEslint(options, ...userConfigs) {
3557
3394
  const { filesTypeAware, parserOptions, useDefaultDefaultProject, ...typeScriptSubOptions } = resolveSubOptions(options, "typescript");
3558
3395
  const projectServiceUserConfig = {
3559
3396
  defaultProject: "./tsconfig.json",
3560
- ...(typeof parserOptions?.projectService === "object"
3561
- ? parserOptions.projectService
3562
- : undefined),
3397
+ ...(typeof parserOptions?.projectService === "object" ? parserOptions.projectService : undefined),
3563
3398
  };
3564
3399
  const typescriptConfigOptions = {
3565
3400
  ...typeScriptSubOptions,
@@ -3685,8 +3520,7 @@ async function rsEslint(options, ...userConfigs) {
3685
3520
  }
3686
3521
  if (markdownOptions !== false) {
3687
3522
  m_configs.push(markdown({
3688
- enableTypeRequiredRules: !(markdownOptions === true ||
3689
- markdownOptions.enableTypeRequiredRules === false),
3523
+ enableTypeRequiredRules: !(markdownOptions === true || markdownOptions.enableTypeRequiredRules === false),
3690
3524
  files: [GLOB_MARKDOWN],
3691
3525
  componentExts,
3692
3526
  overrides: getOverrides(options, "markdown"),
@@ -3703,12 +3537,10 @@ async function rsEslint(options, ...userConfigs) {
3703
3537
  if (autoRenamePlugins) {
3704
3538
  m_composer = m_composer.renamePlugins(defaultPluginRenaming);
3705
3539
  }
3706
- return m_composer;
3540
+ return m_composer.toConfigs();
3707
3541
  }
3708
3542
  function resolveSubOptions(options, key) {
3709
- return (typeof options[key] === "boolean" || typeof options[key] === "string"
3710
- ? {}
3711
- : (options[key] ?? {}));
3543
+ return (typeof options[key] === "boolean" || typeof options[key] === "string" ? {} : (options[key] ?? {}));
3712
3544
  }
3713
3545
  function getOverrides(options, key) {
3714
3546
  const sub = resolveSubOptions(options, key);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rebeccastevens/eslint-config",
3
- "version": "3.0.5",
3
+ "version": "3.0.7",
4
4
  "description": "My ESLint shareable config.",
5
5
  "keywords": [
6
6
  "eslint config"
@@ -59,7 +59,7 @@
59
59
  "local-pkg": "^0.5.0"
60
60
  },
61
61
  "devDependencies": {
62
- "@commitlint/cli": "19.3.0",
62
+ "@commitlint/cli": "19.4.0",
63
63
  "@commitlint/config-conventional": "19.2.2",
64
64
  "@cspell/dict-cryptocurrencies": "5.0.0",
65
65
  "@eslint/compat": "1.1.1",
@@ -79,7 +79,7 @@
79
79
  "@typescript-eslint/utils": "8.0.1",
80
80
  "@unocss/eslint-plugin": "0.61.9",
81
81
  "commitizen": "4.3.0",
82
- "cspell": "8.13.1",
82
+ "cspell": "8.13.2",
83
83
  "cz-conventional-changelog": "3.3.0",
84
84
  "deassert": "1.0.2",
85
85
  "eslint": "9.8.0",