@rebeccastevens/eslint-config 3.7.1 → 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.
- package/CHANGELOG.md +7 -0
- package/dist/index.cjs +95 -85
- package/dist/index.d.cts +1646 -948
- package/dist/index.d.ts +1646 -948
- package/dist/index.js +95 -85
- package/package.json +55 -66
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
All notable changes to this project will be documented in this file. Dates are displayed in UTC.
|
|
3
3
|
|
|
4
|
+
# [3.8.0](https://github.com/RebeccaStevens/eslint-config-rebeccastevens/compare/v3.7.1...v3.8.0) (2025-07-03)
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* deps update and adjustment for them ([28bf1a7](https://github.com/RebeccaStevens/eslint-config-rebeccastevens/commit/28bf1a7ce2ba2c19e1840058889f4901c6b4e305))
|
|
10
|
+
|
|
4
11
|
## [3.7.1](https://github.com/RebeccaStevens/eslint-config-rebeccastevens/compare/v3.7.0...v3.7.1) (2025-03-17)
|
|
5
12
|
|
|
6
13
|
|
package/dist/index.cjs
CHANGED
|
@@ -6,7 +6,6 @@ var path = require('node:path');
|
|
|
6
6
|
var localPkg = require('local-pkg');
|
|
7
7
|
var fs = require('node:fs/promises');
|
|
8
8
|
var globals = require('globals');
|
|
9
|
-
var semver = require('semver');
|
|
10
9
|
|
|
11
10
|
function _interopNamespaceDefault(e) {
|
|
12
11
|
var n = Object.create(null);
|
|
@@ -80,25 +79,23 @@ async function installPackages(packages) {
|
|
|
80
79
|
mut_installPackagesActionResolver(allPackages);
|
|
81
80
|
mut_installPackagesActionResolver = null;
|
|
82
81
|
}, 100);
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
: `Packages are required for this config: ${allPackagesString}.\nDo you want to install them?`,
|
|
96
|
-
});
|
|
97
|
-
if (result !== false) {
|
|
98
|
-
await import('@antfu/install-pkg').then(({ installPackage }) => installPackage(allPackages, { dev: true }));
|
|
99
|
-
}
|
|
82
|
+
mut_installPackagesAction ??= new Promise((resolve) => {
|
|
83
|
+
mut_installPackagesActionResolver = resolve;
|
|
84
|
+
}).then(async (allPackages) => {
|
|
85
|
+
const allPackagesString = allPackages.join(", ");
|
|
86
|
+
if (Boolean(process.env["CI"]) || !process.stdout.isTTY) {
|
|
87
|
+
throw new Error(`Missing packages: ${allPackagesString}`);
|
|
88
|
+
}
|
|
89
|
+
const prompt = await import('@clack/prompts');
|
|
90
|
+
const result = await prompt.confirm({
|
|
91
|
+
message: allPackages.length === 1
|
|
92
|
+
? `${allPackages[0]} is required for this config. Do you want to install it?`
|
|
93
|
+
: `Packages are required for this config: ${allPackagesString}.\nDo you want to install them?`,
|
|
100
94
|
});
|
|
101
|
-
|
|
95
|
+
if (result !== false) {
|
|
96
|
+
await import('@antfu/install-pkg').then(({ installPackage }) => installPackage(allPackages, { dev: true }));
|
|
97
|
+
}
|
|
98
|
+
});
|
|
102
99
|
return mut_installPackagesAction;
|
|
103
100
|
}
|
|
104
101
|
/* eslint-enable functional/no-loop-statements */
|
|
@@ -251,12 +248,7 @@ async function formatters(opts, stylistic) {
|
|
|
251
248
|
"eslint-formatting-reporter",
|
|
252
249
|
"prettier",
|
|
253
250
|
]);
|
|
254
|
-
const
|
|
255
|
-
options.tailwind !== undefined &&
|
|
256
|
-
options.tailwind
|
|
257
|
-
? loadPackages(["prettier-plugin-tailwindcss"])
|
|
258
|
-
: [undefined]);
|
|
259
|
-
const [[pluginFormat, configPrettier, sortPackageJson, formattingReporter], [prettierPluginTailwindcss]] = await Promise.all([packages, prettierPluginTailwindcssPromise]);
|
|
251
|
+
const [pluginFormat, configPrettier, sortPackageJson, formattingReporter] = await packages;
|
|
260
252
|
const turnOffRulesForPrettier = {
|
|
261
253
|
...Object.fromEntries(Object.entries(configPrettier.rules ?? {}).filter(([, value]) => value === "off")),
|
|
262
254
|
// curly: "off",
|
|
@@ -306,10 +298,7 @@ async function formatters(opts, stylistic) {
|
|
|
306
298
|
parser: "babel",
|
|
307
299
|
...(options.tailwind !== undefined && options.tailwind
|
|
308
300
|
? {
|
|
309
|
-
plugins: [
|
|
310
|
-
...(prettierOptions.plugins ?? []),
|
|
311
|
-
...(prettierPluginTailwindcss === undefined ? [] : ["prettier-plugin-tailwindcss"]),
|
|
312
|
-
],
|
|
301
|
+
plugins: prettierOptions.plugins ?? [],
|
|
313
302
|
}
|
|
314
303
|
: {}),
|
|
315
304
|
},
|
|
@@ -331,10 +320,7 @@ async function formatters(opts, stylistic) {
|
|
|
331
320
|
parser: "typescript",
|
|
332
321
|
...(options.tailwind !== undefined && options.tailwind
|
|
333
322
|
? {
|
|
334
|
-
plugins: [
|
|
335
|
-
...(prettierOptions.plugins ?? []),
|
|
336
|
-
...(prettierPluginTailwindcss === undefined ? [] : ["prettier-plugin-tailwindcss"]),
|
|
337
|
-
],
|
|
323
|
+
plugins: prettierOptions.plugins ?? [],
|
|
338
324
|
}
|
|
339
325
|
: {}),
|
|
340
326
|
},
|
|
@@ -2480,7 +2466,7 @@ async function stylistic(options) {
|
|
|
2480
2466
|
"style/computed-property-spacing": "error",
|
|
2481
2467
|
"style/dot-location": ["error", "property"],
|
|
2482
2468
|
"style/eol-last": "error",
|
|
2483
|
-
"style/
|
|
2469
|
+
"style/function-call-spacing": ["error", "never"],
|
|
2484
2470
|
"style/generator-star-spacing": ["error", "after"],
|
|
2485
2471
|
"style/indent": typescript
|
|
2486
2472
|
? "off"
|
|
@@ -2598,11 +2584,12 @@ async function stylistic(options) {
|
|
|
2598
2584
|
"after",
|
|
2599
2585
|
{
|
|
2600
2586
|
overrides: {
|
|
2601
|
-
"=": "none",
|
|
2587
|
+
// "=": "none",
|
|
2602
2588
|
"==": "none",
|
|
2603
2589
|
"===": "none",
|
|
2604
2590
|
"?": "before",
|
|
2605
2591
|
":": "before",
|
|
2592
|
+
"|": "before",
|
|
2606
2593
|
},
|
|
2607
2594
|
},
|
|
2608
2595
|
],
|
|
@@ -2665,72 +2652,67 @@ async function stylistic(options) {
|
|
|
2665
2652
|
}
|
|
2666
2653
|
|
|
2667
2654
|
async function tailwind(options) {
|
|
2668
|
-
const { overrides, stylistic, tailwindVersion
|
|
2669
|
-
const [
|
|
2670
|
-
if (tailwindVersion === 4 &&
|
|
2671
|
-
pluginReadableTailwind.meta?.version !== undefined &&
|
|
2672
|
-
!semver.satisfies(pluginReadableTailwind.meta.version, ">=2.0.0 || >=2.0.0-beta.0")) {
|
|
2673
|
-
console.warn("Please update eslint-plugin-readable-tailwind to version 2.0.0 or higher for tailwindcss v4 support");
|
|
2674
|
-
}
|
|
2675
|
-
const [pluginTailwindCSS] = (await (tailwindVersion === 3 ? loadPackages(["eslint-plugin-tailwindcss"]) : []));
|
|
2655
|
+
const { overrides, stylistic, tailwindVersion, tailwindEntryPoint, tailwindConfig } = options;
|
|
2656
|
+
const [pluginBetterTailwind] = (await loadPackages(["eslint-plugin-better-tailwindcss"]));
|
|
2676
2657
|
return [
|
|
2677
2658
|
{
|
|
2678
|
-
name: "rs:tailwind-
|
|
2659
|
+
name: "rs:tailwind-better",
|
|
2679
2660
|
plugins: {
|
|
2680
|
-
"tailwind-
|
|
2661
|
+
"tailwind-better": pluginBetterTailwind,
|
|
2662
|
+
},
|
|
2663
|
+
settings: {
|
|
2664
|
+
"better-tailwindcss": tailwindVersion === 4
|
|
2665
|
+
? {
|
|
2666
|
+
entryPoint: tailwindEntryPoint,
|
|
2667
|
+
}
|
|
2668
|
+
: // eslint-disable-next-line ts/no-unnecessary-condition
|
|
2669
|
+
tailwindVersion === 3
|
|
2670
|
+
? {
|
|
2671
|
+
tailwindConfig,
|
|
2672
|
+
}
|
|
2673
|
+
: undefined,
|
|
2681
2674
|
},
|
|
2682
2675
|
rules: {
|
|
2683
2676
|
...(stylistic === false
|
|
2684
2677
|
? {}
|
|
2685
2678
|
: {
|
|
2686
|
-
"tailwind-
|
|
2687
|
-
"
|
|
2679
|
+
"tailwind-better/enforce-consistent-line-wrapping": [
|
|
2680
|
+
"error",
|
|
2688
2681
|
{
|
|
2682
|
+
classesPerLine: 0,
|
|
2689
2683
|
group: "newLine",
|
|
2690
2684
|
indent: stylistic.indent,
|
|
2685
|
+
lineBreakStyle: "unix",
|
|
2686
|
+
preferSingleLine: false,
|
|
2691
2687
|
printWidth: stylistic.printWidth,
|
|
2692
2688
|
},
|
|
2693
2689
|
],
|
|
2694
|
-
"tailwind-
|
|
2690
|
+
"tailwind-better/no-unnecessary-whitespace": "warn",
|
|
2691
|
+
"tailwind-better/enforce-consistent-class-order": [
|
|
2692
|
+
"error",
|
|
2693
|
+
{
|
|
2694
|
+
order: "improved",
|
|
2695
|
+
},
|
|
2696
|
+
],
|
|
2697
|
+
"tailwind-better/no-duplicate-classes": "error",
|
|
2698
|
+
"tailwind-better/enforce-consistent-variable-syntax": [
|
|
2699
|
+
"error",
|
|
2700
|
+
{
|
|
2701
|
+
syntax: "parentheses",
|
|
2702
|
+
},
|
|
2703
|
+
],
|
|
2704
|
+
"tailwind-better/no-unregistered-classes": [
|
|
2705
|
+
"off",
|
|
2706
|
+
{
|
|
2707
|
+
detectComponentClasses: true,
|
|
2708
|
+
},
|
|
2709
|
+
],
|
|
2710
|
+
"tailwind-better/no-conflicting-classes": "error",
|
|
2711
|
+
"tailwind-better/no-restricted-classes": "error",
|
|
2695
2712
|
}),
|
|
2696
2713
|
...overrides,
|
|
2697
2714
|
},
|
|
2698
2715
|
},
|
|
2699
|
-
...(tailwindVersion === 3
|
|
2700
|
-
? [
|
|
2701
|
-
{
|
|
2702
|
-
name: "rs:tailwind-3",
|
|
2703
|
-
plugins: {
|
|
2704
|
-
tailwind: pluginTailwindCSS,
|
|
2705
|
-
},
|
|
2706
|
-
rules: {
|
|
2707
|
-
"tailwind/no-contradicting-classname": "error",
|
|
2708
|
-
"tailwind/no-arbitrary-value": "off",
|
|
2709
|
-
"tailwind/no-custom-classname": "off",
|
|
2710
|
-
...(stylistic === false
|
|
2711
|
-
? {}
|
|
2712
|
-
: {
|
|
2713
|
-
"tailwind/classnames-order": "warn",
|
|
2714
|
-
"tailwind/enforces-negative-arbitrary-values": "warn",
|
|
2715
|
-
"tailwind/enforces-shorthand": "warn",
|
|
2716
|
-
"tailwind/no-unnecessary-arbitrary-value": "warn",
|
|
2717
|
-
}),
|
|
2718
|
-
...overrides,
|
|
2719
|
-
},
|
|
2720
|
-
},
|
|
2721
|
-
]
|
|
2722
|
-
: []),
|
|
2723
|
-
// ...((tailwindVersion === 4
|
|
2724
|
-
// ? [
|
|
2725
|
-
// {
|
|
2726
|
-
// name: "rs:tailwind-4",
|
|
2727
|
-
// plugins: {},
|
|
2728
|
-
// rules: {
|
|
2729
|
-
// ...overrides,
|
|
2730
|
-
// },
|
|
2731
|
-
// },
|
|
2732
|
-
// ]
|
|
2733
|
-
// : []) satisfies FlatConfigItem[]),
|
|
2734
2716
|
];
|
|
2735
2717
|
}
|
|
2736
2718
|
|
|
@@ -2932,6 +2914,7 @@ async function typescript(options) {
|
|
|
2932
2914
|
"ts/no-unnecessary-type-arguments": "error",
|
|
2933
2915
|
"ts/no-unnecessary-type-assertion": "error",
|
|
2934
2916
|
"ts/no-unnecessary-type-constraint": "error",
|
|
2917
|
+
"ts/no-unnecessary-type-conversion": "error",
|
|
2935
2918
|
"ts/no-unsafe-argument": unsafe,
|
|
2936
2919
|
"ts/no-unsafe-assignment": unsafe,
|
|
2937
2920
|
"ts/no-unsafe-call": unsafe,
|
|
@@ -3045,7 +3028,14 @@ async function typescript(options) {
|
|
|
3045
3028
|
},
|
|
3046
3029
|
],
|
|
3047
3030
|
"no-throw-literal": "off",
|
|
3048
|
-
"ts/only-throw-error":
|
|
3031
|
+
"ts/only-throw-error": [
|
|
3032
|
+
"error",
|
|
3033
|
+
{
|
|
3034
|
+
allowRethrowing: true,
|
|
3035
|
+
allowThrowingAny: true,
|
|
3036
|
+
allowThrowingUnknown: false,
|
|
3037
|
+
},
|
|
3038
|
+
],
|
|
3049
3039
|
"dot-notation": "off",
|
|
3050
3040
|
"ts/dot-notation": ["error", { allowIndexSignaturePropertyAccess: true }],
|
|
3051
3041
|
"ts/consistent-indexed-object-style": "error",
|
|
@@ -3812,9 +3802,29 @@ async function rsEslint(options, ...userConfigs) {
|
|
|
3812
3802
|
}));
|
|
3813
3803
|
}
|
|
3814
3804
|
if (tailwindOptions !== false) {
|
|
3805
|
+
const tailwindVersion = (tailwindOptions === true
|
|
3806
|
+
? undefined
|
|
3807
|
+
: (tailwindOptions.tailwindVersion ??
|
|
3808
|
+
("tailwindEntryPoint" in tailwindOptions ? 4 : "tailwindConfig" in tailwindOptions ? 3 : undefined))) ?? 3;
|
|
3809
|
+
const tailwindConfig = tailwindVersion === 3
|
|
3810
|
+
? ((tailwindOptions === true
|
|
3811
|
+
? undefined
|
|
3812
|
+
: "tailwindConfig" in tailwindOptions
|
|
3813
|
+
? tailwindOptions.tailwindConfig
|
|
3814
|
+
: undefined) ?? "tailwind.config.js")
|
|
3815
|
+
: undefined;
|
|
3816
|
+
const tailwindEntryPoint = tailwindVersion === 4
|
|
3817
|
+
? tailwindOptions === true
|
|
3818
|
+
? undefined
|
|
3819
|
+
: "tailwindEntryPoint" in tailwindOptions
|
|
3820
|
+
? tailwindOptions.tailwindEntryPoint
|
|
3821
|
+
: undefined
|
|
3822
|
+
: undefined;
|
|
3815
3823
|
mut_configs.push(tailwind({
|
|
3816
3824
|
stylistic: stylisticOptions,
|
|
3817
|
-
tailwindVersion
|
|
3825
|
+
tailwindVersion,
|
|
3826
|
+
tailwindConfig,
|
|
3827
|
+
tailwindEntryPoint,
|
|
3818
3828
|
overrides: getOverrides(options, "tailwind"),
|
|
3819
3829
|
}));
|
|
3820
3830
|
}
|