@rebeccastevens/eslint-config 3.2.0 → 3.2.2
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 +31 -18
- package/dist/index.d.cts +40 -38
- package/dist/index.d.mts +40 -38
- package/dist/index.mjs +31 -18
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -228,10 +228,10 @@ async function formatters(opts, stylistic) {
|
|
|
228
228
|
if (options.slidev !== false && options.slidev !== undefined && options.markdown !== true) {
|
|
229
229
|
throw new Error("`slidev` option only works when `markdown` is enabled with `prettier`");
|
|
230
230
|
}
|
|
231
|
-
const { indent, quotes, semi } = stylistic;
|
|
231
|
+
const { indent, printWidth, quotes, semi } = stylistic;
|
|
232
232
|
const prettierOptions = Object.assign({
|
|
233
233
|
endOfLine: "lf",
|
|
234
|
-
printWidth: 120,
|
|
234
|
+
printWidth: printWidth ?? 120,
|
|
235
235
|
semi: semi ?? true,
|
|
236
236
|
singleQuote: quotes === "single",
|
|
237
237
|
tabWidth: typeof indent === "number" ? indent : 2,
|
|
@@ -2484,6 +2484,7 @@ const StylisticConfigDefaults = {
|
|
|
2484
2484
|
jsx: true,
|
|
2485
2485
|
quotes: "double",
|
|
2486
2486
|
semi: true,
|
|
2487
|
+
printWidth: 120,
|
|
2487
2488
|
};
|
|
2488
2489
|
async function stylistic(options) {
|
|
2489
2490
|
const { stylistic: { indent, jsx, quotes, semi }, overrides, typescript, } = options;
|
|
@@ -2716,7 +2717,7 @@ async function stylistic(options) {
|
|
|
2716
2717
|
}
|
|
2717
2718
|
|
|
2718
2719
|
async function tailwind(options) {
|
|
2719
|
-
const { overrides } = options;
|
|
2720
|
+
const { overrides, stylistic } = options;
|
|
2720
2721
|
const [pluginTailwindCSS, pluginReadableTailwind] = (await loadPackages([
|
|
2721
2722
|
"eslint-plugin-tailwindcss",
|
|
2722
2723
|
"eslint-plugin-readable-tailwind",
|
|
@@ -2725,19 +2726,30 @@ async function tailwind(options) {
|
|
|
2725
2726
|
{
|
|
2726
2727
|
name: "js:tailwindcss",
|
|
2727
2728
|
plugins: {
|
|
2728
|
-
|
|
2729
|
-
"
|
|
2729
|
+
tailwind: pluginTailwindCSS,
|
|
2730
|
+
"tailwind-readable": pluginReadableTailwind,
|
|
2730
2731
|
},
|
|
2731
2732
|
rules: {
|
|
2732
|
-
"
|
|
2733
|
-
"
|
|
2734
|
-
"
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2733
|
+
"tailwind/no-contradicting-classname": "error",
|
|
2734
|
+
"tailwind/no-arbitrary-value": "off",
|
|
2735
|
+
"tailwind/no-custom-classname": "off",
|
|
2736
|
+
...(stylistic === false
|
|
2737
|
+
? {}
|
|
2738
|
+
: {
|
|
2739
|
+
"tailwind/classnames-order": "warn",
|
|
2740
|
+
"tailwind/enforces-negative-arbitrary-values": "warn",
|
|
2741
|
+
"tailwind/enforces-shorthand": "warn",
|
|
2742
|
+
"tailwind/no-unnecessary-arbitrary-value": "warn",
|
|
2743
|
+
"tailwind-readable/multiline": [
|
|
2744
|
+
"warn",
|
|
2745
|
+
{
|
|
2746
|
+
group: "newLine",
|
|
2747
|
+
indent: stylistic.indent,
|
|
2748
|
+
printWidth: stylistic.printWidth,
|
|
2749
|
+
},
|
|
2750
|
+
],
|
|
2751
|
+
"tailwind-readable/no-unnecessary-whitespace": "warn",
|
|
2752
|
+
}),
|
|
2741
2753
|
...overrides,
|
|
2742
2754
|
},
|
|
2743
2755
|
},
|
|
@@ -3144,21 +3156,21 @@ async function typescript(options) {
|
|
|
3144
3156
|
modifiers: ["destructured"],
|
|
3145
3157
|
},
|
|
3146
3158
|
{
|
|
3147
|
-
selector: "
|
|
3159
|
+
selector: ["autoAccessor", "parameterProperty", "property"],
|
|
3148
3160
|
filter: { regex: "^[A-Z0-9_]+$", match: true },
|
|
3149
3161
|
format: ["UPPER_CASE"],
|
|
3150
3162
|
leadingUnderscore: "forbid",
|
|
3151
3163
|
trailingUnderscore: "forbid",
|
|
3152
3164
|
},
|
|
3153
3165
|
{
|
|
3154
|
-
selector: "
|
|
3166
|
+
selector: ["autoAccessor", "parameterProperty", "property"],
|
|
3155
3167
|
format: ["camelCase", "PascalCase"],
|
|
3156
3168
|
prefix: ["m_", "M_"],
|
|
3157
3169
|
leadingUnderscore: "forbid",
|
|
3158
3170
|
trailingUnderscore: "forbid",
|
|
3159
3171
|
},
|
|
3160
3172
|
{
|
|
3161
|
-
selector: "
|
|
3173
|
+
selector: ["autoAccessor", "parameterProperty", "property"],
|
|
3162
3174
|
filter: { regex: "_[^_]+", match: true },
|
|
3163
3175
|
format: ["camelCase", "PascalCase"],
|
|
3164
3176
|
modifiers: ["readonly"],
|
|
@@ -3167,7 +3179,7 @@ async function typescript(options) {
|
|
|
3167
3179
|
trailingUnderscore: "forbid",
|
|
3168
3180
|
},
|
|
3169
3181
|
{
|
|
3170
|
-
selector: "
|
|
3182
|
+
selector: ["autoAccessor", "parameterProperty", "property"],
|
|
3171
3183
|
format: ["camelCase", "PascalCase", "UPPER_CASE"],
|
|
3172
3184
|
modifiers: ["readonly"],
|
|
3173
3185
|
leadingUnderscore: "allow",
|
|
@@ -3765,6 +3777,7 @@ async function rsEslint(options, ...userConfigs) {
|
|
|
3765
3777
|
}
|
|
3766
3778
|
if (tailwindOptions !== false) {
|
|
3767
3779
|
m_configs.push(tailwind({
|
|
3780
|
+
stylistic: stylisticOptions,
|
|
3768
3781
|
overrides: getOverrides(options, "tailwind"),
|
|
3769
3782
|
}));
|
|
3770
3783
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -2804,62 +2804,62 @@ interface RuleOptions {
|
|
|
2804
2804
|
* Enforce consistent line wrapping for tailwind classes.
|
|
2805
2805
|
* @see https://github.com/schoero/eslint-plugin-readable-tailwind/blob/main/docs/rules/multiline.md
|
|
2806
2806
|
*/
|
|
2807
|
-
"
|
|
2807
|
+
"tailwind-readable/multiline"?: Linter.RuleEntry<TailwindReadableMultiline>;
|
|
2808
2808
|
/**
|
|
2809
2809
|
* Disallow duplicate class names in tailwind classes.
|
|
2810
2810
|
* @see https://github.com/schoero/eslint-plugin-readable-tailwind/blob/main/docs/rules/no-duplicate-classes.md
|
|
2811
2811
|
*/
|
|
2812
|
-
"
|
|
2812
|
+
"tailwind-readable/no-duplicate-classes"?: Linter.RuleEntry<TailwindReadableNoDuplicateClasses>;
|
|
2813
2813
|
/**
|
|
2814
2814
|
* Disallow unnecessary whitespace in tailwind classes.
|
|
2815
2815
|
* @see https://github.com/schoero/eslint-plugin-readable-tailwind/blob/main/docs/rules/no-unnecessary-whitespace.md
|
|
2816
2816
|
*/
|
|
2817
|
-
"
|
|
2817
|
+
"tailwind-readable/no-unnecessary-whitespace"?: Linter.RuleEntry<TailwindReadableNoUnnecessaryWhitespace>;
|
|
2818
2818
|
/**
|
|
2819
2819
|
* Enforce a consistent order for tailwind classes.
|
|
2820
2820
|
* @see https://github.com/schoero/eslint-plugin-readable-tailwind/blob/main/docs/rules/sort-classes.md
|
|
2821
2821
|
*/
|
|
2822
|
-
"
|
|
2822
|
+
"tailwind-readable/sort-classes"?: Linter.RuleEntry<TailwindReadableSortClasses>;
|
|
2823
2823
|
/**
|
|
2824
2824
|
* Enforce a consistent and logical order of the Tailwind CSS classnames
|
|
2825
2825
|
* @see https://github.com/francoismassart/eslint-plugin-tailwindcss/tree/master/docs/rules/classnames-order.md
|
|
2826
2826
|
*/
|
|
2827
|
-
"
|
|
2827
|
+
"tailwind/classnames-order"?: Linter.RuleEntry<TailwindClassnamesOrder>;
|
|
2828
2828
|
/**
|
|
2829
2829
|
* Warns about dash prefixed classnames using arbitrary values
|
|
2830
2830
|
* @see https://github.com/francoismassart/eslint-plugin-tailwindcss/tree/master/docs/rules/enforces-negative-arbitrary-values.md
|
|
2831
2831
|
*/
|
|
2832
|
-
"
|
|
2832
|
+
"tailwind/enforces-negative-arbitrary-values"?: Linter.RuleEntry<TailwindEnforcesNegativeArbitraryValues>;
|
|
2833
2833
|
/**
|
|
2834
2834
|
* Enforces the usage of shorthand Tailwind CSS classnames
|
|
2835
2835
|
* @see https://github.com/francoismassart/eslint-plugin-tailwindcss/tree/master/docs/rules/enforces-shorthand.md
|
|
2836
2836
|
*/
|
|
2837
|
-
"
|
|
2837
|
+
"tailwind/enforces-shorthand"?: Linter.RuleEntry<TailwindEnforcesShorthand>;
|
|
2838
2838
|
/**
|
|
2839
2839
|
* Detect obsolete classnames when upgrading to Tailwind CSS v3
|
|
2840
2840
|
* @see https://github.com/francoismassart/eslint-plugin-tailwindcss/tree/master/docs/rules/migration-from-tailwind-2.md
|
|
2841
2841
|
*/
|
|
2842
|
-
"
|
|
2842
|
+
"tailwind/migration-from-tailwind-2"?: Linter.RuleEntry<TailwindMigrationFromTailwind2>;
|
|
2843
2843
|
/**
|
|
2844
2844
|
* Forbid using arbitrary values in classnames
|
|
2845
2845
|
* @see https://github.com/francoismassart/eslint-plugin-tailwindcss/tree/master/docs/rules/no-arbitrary-value.md
|
|
2846
2846
|
*/
|
|
2847
|
-
"
|
|
2847
|
+
"tailwind/no-arbitrary-value"?: Linter.RuleEntry<TailwindNoArbitraryValue>;
|
|
2848
2848
|
/**
|
|
2849
2849
|
* Avoid contradicting Tailwind CSS classnames (e.g. "w-3 w-5")
|
|
2850
2850
|
* @see https://github.com/francoismassart/eslint-plugin-tailwindcss/tree/master/docs/rules/no-contradicting-classname.md
|
|
2851
2851
|
*/
|
|
2852
|
-
"
|
|
2852
|
+
"tailwind/no-contradicting-classname"?: Linter.RuleEntry<TailwindNoContradictingClassname>;
|
|
2853
2853
|
/**
|
|
2854
2854
|
* Detect classnames which do not belong to Tailwind CSS
|
|
2855
2855
|
* @see https://github.com/francoismassart/eslint-plugin-tailwindcss/tree/master/docs/rules/no-custom-classname.md
|
|
2856
2856
|
*/
|
|
2857
|
-
"
|
|
2857
|
+
"tailwind/no-custom-classname"?: Linter.RuleEntry<TailwindNoCustomClassname>;
|
|
2858
2858
|
/**
|
|
2859
2859
|
* Forbid using arbitrary values in classnames when an equivalent preset exists
|
|
2860
2860
|
* @see https://github.com/francoismassart/eslint-plugin-tailwindcss/tree/master/docs/rules/no-unnecessary-arbitrary-value.md
|
|
2861
2861
|
*/
|
|
2862
|
-
"
|
|
2862
|
+
"tailwind/no-unnecessary-arbitrary-value"?: Linter.RuleEntry<TailwindNoUnnecessaryArbitraryValue>;
|
|
2863
2863
|
/**
|
|
2864
2864
|
* require .spec test file pattern
|
|
2865
2865
|
* @see https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/consistent-test-filename.md
|
|
@@ -10233,8 +10233,8 @@ type StyleYieldStarSpacing = [
|
|
|
10233
10233
|
after?: boolean;
|
|
10234
10234
|
})
|
|
10235
10235
|
];
|
|
10236
|
-
// -----
|
|
10237
|
-
type
|
|
10236
|
+
// ----- tailwind-readable/multiline -----
|
|
10237
|
+
type TailwindReadableMultiline = [
|
|
10238
10238
|
] | [
|
|
10239
10239
|
{
|
|
10240
10240
|
callees?: ([
|
|
@@ -10316,8 +10316,8 @@ type TailwindcssReadableMultiline = [
|
|
|
10316
10316
|
printWidth?: number;
|
|
10317
10317
|
}
|
|
10318
10318
|
];
|
|
10319
|
-
// -----
|
|
10320
|
-
type
|
|
10319
|
+
// ----- tailwind-readable/no-duplicate-classes -----
|
|
10320
|
+
type TailwindReadableNoDuplicateClasses = [
|
|
10321
10321
|
] | [
|
|
10322
10322
|
{
|
|
10323
10323
|
callees?: ([
|
|
@@ -10394,8 +10394,8 @@ type TailwindcssReadableNoDuplicateClasses = [
|
|
|
10394
10394
|
] | string)[];
|
|
10395
10395
|
}
|
|
10396
10396
|
];
|
|
10397
|
-
// -----
|
|
10398
|
-
type
|
|
10397
|
+
// ----- tailwind-readable/no-unnecessary-whitespace -----
|
|
10398
|
+
type TailwindReadableNoUnnecessaryWhitespace = [
|
|
10399
10399
|
] | [
|
|
10400
10400
|
{
|
|
10401
10401
|
allowMultiline?: boolean;
|
|
@@ -10473,8 +10473,8 @@ type TailwindcssReadableNoUnnecessaryWhitespace = [
|
|
|
10473
10473
|
] | string)[];
|
|
10474
10474
|
}
|
|
10475
10475
|
];
|
|
10476
|
-
// -----
|
|
10477
|
-
type
|
|
10476
|
+
// ----- tailwind-readable/sort-classes -----
|
|
10477
|
+
type TailwindReadableSortClasses = [
|
|
10478
10478
|
] | [
|
|
10479
10479
|
{
|
|
10480
10480
|
callees?: ([
|
|
@@ -10553,8 +10553,8 @@ type TailwindcssReadableSortClasses = [
|
|
|
10553
10553
|
tailwindConfig?: string;
|
|
10554
10554
|
}
|
|
10555
10555
|
];
|
|
10556
|
-
// -----
|
|
10557
|
-
type
|
|
10556
|
+
// ----- tailwind/classnames-order -----
|
|
10557
|
+
type TailwindClassnamesOrder = [
|
|
10558
10558
|
] | [
|
|
10559
10559
|
{
|
|
10560
10560
|
callees?: string[];
|
|
@@ -10567,8 +10567,8 @@ type TailwindcssClassnamesOrder = [
|
|
|
10567
10567
|
[k: string]: unknown | undefined;
|
|
10568
10568
|
}
|
|
10569
10569
|
];
|
|
10570
|
-
// -----
|
|
10571
|
-
type
|
|
10570
|
+
// ----- tailwind/enforces-negative-arbitrary-values -----
|
|
10571
|
+
type TailwindEnforcesNegativeArbitraryValues = [
|
|
10572
10572
|
] | [
|
|
10573
10573
|
{
|
|
10574
10574
|
callees?: string[];
|
|
@@ -10580,8 +10580,8 @@ type TailwindcssEnforcesNegativeArbitraryValues = [
|
|
|
10580
10580
|
[k: string]: unknown | undefined;
|
|
10581
10581
|
}
|
|
10582
10582
|
];
|
|
10583
|
-
// -----
|
|
10584
|
-
type
|
|
10583
|
+
// ----- tailwind/enforces-shorthand -----
|
|
10584
|
+
type TailwindEnforcesShorthand = [
|
|
10585
10585
|
] | [
|
|
10586
10586
|
{
|
|
10587
10587
|
callees?: string[];
|
|
@@ -10593,8 +10593,8 @@ type TailwindcssEnforcesShorthand = [
|
|
|
10593
10593
|
[k: string]: unknown | undefined;
|
|
10594
10594
|
}
|
|
10595
10595
|
];
|
|
10596
|
-
// -----
|
|
10597
|
-
type
|
|
10596
|
+
// ----- tailwind/migration-from-tailwind-2 -----
|
|
10597
|
+
type TailwindMigrationFromTailwind2 = [
|
|
10598
10598
|
] | [
|
|
10599
10599
|
{
|
|
10600
10600
|
callees?: string[];
|
|
@@ -10606,8 +10606,8 @@ type TailwindcssMigrationFromTailwind2 = [
|
|
|
10606
10606
|
[k: string]: unknown | undefined;
|
|
10607
10607
|
}
|
|
10608
10608
|
];
|
|
10609
|
-
// -----
|
|
10610
|
-
type
|
|
10609
|
+
// ----- tailwind/no-arbitrary-value -----
|
|
10610
|
+
type TailwindNoArbitraryValue = [
|
|
10611
10611
|
] | [
|
|
10612
10612
|
{
|
|
10613
10613
|
callees?: string[];
|
|
@@ -10619,8 +10619,8 @@ type TailwindcssNoArbitraryValue = [
|
|
|
10619
10619
|
[k: string]: unknown | undefined;
|
|
10620
10620
|
}
|
|
10621
10621
|
];
|
|
10622
|
-
// -----
|
|
10623
|
-
type
|
|
10622
|
+
// ----- tailwind/no-contradicting-classname -----
|
|
10623
|
+
type TailwindNoContradictingClassname = [
|
|
10624
10624
|
] | [
|
|
10625
10625
|
{
|
|
10626
10626
|
callees?: string[];
|
|
@@ -10632,8 +10632,8 @@ type TailwindcssNoContradictingClassname = [
|
|
|
10632
10632
|
[k: string]: unknown | undefined;
|
|
10633
10633
|
}
|
|
10634
10634
|
];
|
|
10635
|
-
// -----
|
|
10636
|
-
type
|
|
10635
|
+
// ----- tailwind/no-custom-classname -----
|
|
10636
|
+
type TailwindNoCustomClassname = [
|
|
10637
10637
|
] | [
|
|
10638
10638
|
{
|
|
10639
10639
|
callees?: string[];
|
|
@@ -10648,8 +10648,8 @@ type TailwindcssNoCustomClassname = [
|
|
|
10648
10648
|
[k: string]: unknown | undefined;
|
|
10649
10649
|
}
|
|
10650
10650
|
];
|
|
10651
|
-
// -----
|
|
10652
|
-
type
|
|
10651
|
+
// ----- tailwind/no-unnecessary-arbitrary-value -----
|
|
10652
|
+
type TailwindNoUnnecessaryArbitraryValue = [
|
|
10653
10653
|
] | [
|
|
10654
10654
|
{
|
|
10655
10655
|
callees?: string[];
|
|
@@ -14498,7 +14498,9 @@ type OptionsStylistic = {
|
|
|
14498
14498
|
type RequiredOptionsStylistic = {
|
|
14499
14499
|
stylistic: Required<StylisticConfig> | false;
|
|
14500
14500
|
};
|
|
14501
|
-
type StylisticConfig = {
|
|
14501
|
+
type StylisticConfig = {
|
|
14502
|
+
printWidth?: number;
|
|
14503
|
+
} & Pick<StylisticCustomizeOptions, "indent" | "quotes" | "jsx" | "semi">;
|
|
14502
14504
|
type OptionsOverrides = {
|
|
14503
14505
|
overrides?: FlatConfigItem["rules"];
|
|
14504
14506
|
};
|
|
@@ -14664,7 +14666,7 @@ declare const StylisticConfigDefaults: Required<StylisticConfig>;
|
|
|
14664
14666
|
declare function stylistic(options: Readonly<Required<{
|
|
14665
14667
|
stylistic: Required<StylisticConfig>;
|
|
14666
14668
|
} & OptionsOverrides & OptionsHasTypeScript>>): Promise<FlatConfigItem[]>;
|
|
14667
|
-
declare function tailwind(options: Readonly<Required<OptionsTailwindCSS
|
|
14669
|
+
declare function tailwind(options: Readonly<Required<OptionsTailwindCSS> & RequiredOptionsStylistic>): Promise<FlatConfigItem[]>;
|
|
14668
14670
|
declare function test(options: Readonly<Required<OptionsFiles & OptionsOverrides>>): Promise<FlatConfigItem[]>;
|
|
14669
14671
|
declare function toml(options: Readonly<Required<OptionsOverrides & RequiredOptionsStylistic & OptionsFiles>>): Promise<FlatConfigItem[]>;
|
|
14670
14672
|
declare const defaultFilesTypesAware: string[];
|
package/dist/index.d.mts
CHANGED
|
@@ -2804,62 +2804,62 @@ interface RuleOptions {
|
|
|
2804
2804
|
* Enforce consistent line wrapping for tailwind classes.
|
|
2805
2805
|
* @see https://github.com/schoero/eslint-plugin-readable-tailwind/blob/main/docs/rules/multiline.md
|
|
2806
2806
|
*/
|
|
2807
|
-
"
|
|
2807
|
+
"tailwind-readable/multiline"?: Linter.RuleEntry<TailwindReadableMultiline>;
|
|
2808
2808
|
/**
|
|
2809
2809
|
* Disallow duplicate class names in tailwind classes.
|
|
2810
2810
|
* @see https://github.com/schoero/eslint-plugin-readable-tailwind/blob/main/docs/rules/no-duplicate-classes.md
|
|
2811
2811
|
*/
|
|
2812
|
-
"
|
|
2812
|
+
"tailwind-readable/no-duplicate-classes"?: Linter.RuleEntry<TailwindReadableNoDuplicateClasses>;
|
|
2813
2813
|
/**
|
|
2814
2814
|
* Disallow unnecessary whitespace in tailwind classes.
|
|
2815
2815
|
* @see https://github.com/schoero/eslint-plugin-readable-tailwind/blob/main/docs/rules/no-unnecessary-whitespace.md
|
|
2816
2816
|
*/
|
|
2817
|
-
"
|
|
2817
|
+
"tailwind-readable/no-unnecessary-whitespace"?: Linter.RuleEntry<TailwindReadableNoUnnecessaryWhitespace>;
|
|
2818
2818
|
/**
|
|
2819
2819
|
* Enforce a consistent order for tailwind classes.
|
|
2820
2820
|
* @see https://github.com/schoero/eslint-plugin-readable-tailwind/blob/main/docs/rules/sort-classes.md
|
|
2821
2821
|
*/
|
|
2822
|
-
"
|
|
2822
|
+
"tailwind-readable/sort-classes"?: Linter.RuleEntry<TailwindReadableSortClasses>;
|
|
2823
2823
|
/**
|
|
2824
2824
|
* Enforce a consistent and logical order of the Tailwind CSS classnames
|
|
2825
2825
|
* @see https://github.com/francoismassart/eslint-plugin-tailwindcss/tree/master/docs/rules/classnames-order.md
|
|
2826
2826
|
*/
|
|
2827
|
-
"
|
|
2827
|
+
"tailwind/classnames-order"?: Linter.RuleEntry<TailwindClassnamesOrder>;
|
|
2828
2828
|
/**
|
|
2829
2829
|
* Warns about dash prefixed classnames using arbitrary values
|
|
2830
2830
|
* @see https://github.com/francoismassart/eslint-plugin-tailwindcss/tree/master/docs/rules/enforces-negative-arbitrary-values.md
|
|
2831
2831
|
*/
|
|
2832
|
-
"
|
|
2832
|
+
"tailwind/enforces-negative-arbitrary-values"?: Linter.RuleEntry<TailwindEnforcesNegativeArbitraryValues>;
|
|
2833
2833
|
/**
|
|
2834
2834
|
* Enforces the usage of shorthand Tailwind CSS classnames
|
|
2835
2835
|
* @see https://github.com/francoismassart/eslint-plugin-tailwindcss/tree/master/docs/rules/enforces-shorthand.md
|
|
2836
2836
|
*/
|
|
2837
|
-
"
|
|
2837
|
+
"tailwind/enforces-shorthand"?: Linter.RuleEntry<TailwindEnforcesShorthand>;
|
|
2838
2838
|
/**
|
|
2839
2839
|
* Detect obsolete classnames when upgrading to Tailwind CSS v3
|
|
2840
2840
|
* @see https://github.com/francoismassart/eslint-plugin-tailwindcss/tree/master/docs/rules/migration-from-tailwind-2.md
|
|
2841
2841
|
*/
|
|
2842
|
-
"
|
|
2842
|
+
"tailwind/migration-from-tailwind-2"?: Linter.RuleEntry<TailwindMigrationFromTailwind2>;
|
|
2843
2843
|
/**
|
|
2844
2844
|
* Forbid using arbitrary values in classnames
|
|
2845
2845
|
* @see https://github.com/francoismassart/eslint-plugin-tailwindcss/tree/master/docs/rules/no-arbitrary-value.md
|
|
2846
2846
|
*/
|
|
2847
|
-
"
|
|
2847
|
+
"tailwind/no-arbitrary-value"?: Linter.RuleEntry<TailwindNoArbitraryValue>;
|
|
2848
2848
|
/**
|
|
2849
2849
|
* Avoid contradicting Tailwind CSS classnames (e.g. "w-3 w-5")
|
|
2850
2850
|
* @see https://github.com/francoismassart/eslint-plugin-tailwindcss/tree/master/docs/rules/no-contradicting-classname.md
|
|
2851
2851
|
*/
|
|
2852
|
-
"
|
|
2852
|
+
"tailwind/no-contradicting-classname"?: Linter.RuleEntry<TailwindNoContradictingClassname>;
|
|
2853
2853
|
/**
|
|
2854
2854
|
* Detect classnames which do not belong to Tailwind CSS
|
|
2855
2855
|
* @see https://github.com/francoismassart/eslint-plugin-tailwindcss/tree/master/docs/rules/no-custom-classname.md
|
|
2856
2856
|
*/
|
|
2857
|
-
"
|
|
2857
|
+
"tailwind/no-custom-classname"?: Linter.RuleEntry<TailwindNoCustomClassname>;
|
|
2858
2858
|
/**
|
|
2859
2859
|
* Forbid using arbitrary values in classnames when an equivalent preset exists
|
|
2860
2860
|
* @see https://github.com/francoismassart/eslint-plugin-tailwindcss/tree/master/docs/rules/no-unnecessary-arbitrary-value.md
|
|
2861
2861
|
*/
|
|
2862
|
-
"
|
|
2862
|
+
"tailwind/no-unnecessary-arbitrary-value"?: Linter.RuleEntry<TailwindNoUnnecessaryArbitraryValue>;
|
|
2863
2863
|
/**
|
|
2864
2864
|
* require .spec test file pattern
|
|
2865
2865
|
* @see https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/consistent-test-filename.md
|
|
@@ -10233,8 +10233,8 @@ type StyleYieldStarSpacing = [
|
|
|
10233
10233
|
after?: boolean;
|
|
10234
10234
|
})
|
|
10235
10235
|
];
|
|
10236
|
-
// -----
|
|
10237
|
-
type
|
|
10236
|
+
// ----- tailwind-readable/multiline -----
|
|
10237
|
+
type TailwindReadableMultiline = [
|
|
10238
10238
|
] | [
|
|
10239
10239
|
{
|
|
10240
10240
|
callees?: ([
|
|
@@ -10316,8 +10316,8 @@ type TailwindcssReadableMultiline = [
|
|
|
10316
10316
|
printWidth?: number;
|
|
10317
10317
|
}
|
|
10318
10318
|
];
|
|
10319
|
-
// -----
|
|
10320
|
-
type
|
|
10319
|
+
// ----- tailwind-readable/no-duplicate-classes -----
|
|
10320
|
+
type TailwindReadableNoDuplicateClasses = [
|
|
10321
10321
|
] | [
|
|
10322
10322
|
{
|
|
10323
10323
|
callees?: ([
|
|
@@ -10394,8 +10394,8 @@ type TailwindcssReadableNoDuplicateClasses = [
|
|
|
10394
10394
|
] | string)[];
|
|
10395
10395
|
}
|
|
10396
10396
|
];
|
|
10397
|
-
// -----
|
|
10398
|
-
type
|
|
10397
|
+
// ----- tailwind-readable/no-unnecessary-whitespace -----
|
|
10398
|
+
type TailwindReadableNoUnnecessaryWhitespace = [
|
|
10399
10399
|
] | [
|
|
10400
10400
|
{
|
|
10401
10401
|
allowMultiline?: boolean;
|
|
@@ -10473,8 +10473,8 @@ type TailwindcssReadableNoUnnecessaryWhitespace = [
|
|
|
10473
10473
|
] | string)[];
|
|
10474
10474
|
}
|
|
10475
10475
|
];
|
|
10476
|
-
// -----
|
|
10477
|
-
type
|
|
10476
|
+
// ----- tailwind-readable/sort-classes -----
|
|
10477
|
+
type TailwindReadableSortClasses = [
|
|
10478
10478
|
] | [
|
|
10479
10479
|
{
|
|
10480
10480
|
callees?: ([
|
|
@@ -10553,8 +10553,8 @@ type TailwindcssReadableSortClasses = [
|
|
|
10553
10553
|
tailwindConfig?: string;
|
|
10554
10554
|
}
|
|
10555
10555
|
];
|
|
10556
|
-
// -----
|
|
10557
|
-
type
|
|
10556
|
+
// ----- tailwind/classnames-order -----
|
|
10557
|
+
type TailwindClassnamesOrder = [
|
|
10558
10558
|
] | [
|
|
10559
10559
|
{
|
|
10560
10560
|
callees?: string[];
|
|
@@ -10567,8 +10567,8 @@ type TailwindcssClassnamesOrder = [
|
|
|
10567
10567
|
[k: string]: unknown | undefined;
|
|
10568
10568
|
}
|
|
10569
10569
|
];
|
|
10570
|
-
// -----
|
|
10571
|
-
type
|
|
10570
|
+
// ----- tailwind/enforces-negative-arbitrary-values -----
|
|
10571
|
+
type TailwindEnforcesNegativeArbitraryValues = [
|
|
10572
10572
|
] | [
|
|
10573
10573
|
{
|
|
10574
10574
|
callees?: string[];
|
|
@@ -10580,8 +10580,8 @@ type TailwindcssEnforcesNegativeArbitraryValues = [
|
|
|
10580
10580
|
[k: string]: unknown | undefined;
|
|
10581
10581
|
}
|
|
10582
10582
|
];
|
|
10583
|
-
// -----
|
|
10584
|
-
type
|
|
10583
|
+
// ----- tailwind/enforces-shorthand -----
|
|
10584
|
+
type TailwindEnforcesShorthand = [
|
|
10585
10585
|
] | [
|
|
10586
10586
|
{
|
|
10587
10587
|
callees?: string[];
|
|
@@ -10593,8 +10593,8 @@ type TailwindcssEnforcesShorthand = [
|
|
|
10593
10593
|
[k: string]: unknown | undefined;
|
|
10594
10594
|
}
|
|
10595
10595
|
];
|
|
10596
|
-
// -----
|
|
10597
|
-
type
|
|
10596
|
+
// ----- tailwind/migration-from-tailwind-2 -----
|
|
10597
|
+
type TailwindMigrationFromTailwind2 = [
|
|
10598
10598
|
] | [
|
|
10599
10599
|
{
|
|
10600
10600
|
callees?: string[];
|
|
@@ -10606,8 +10606,8 @@ type TailwindcssMigrationFromTailwind2 = [
|
|
|
10606
10606
|
[k: string]: unknown | undefined;
|
|
10607
10607
|
}
|
|
10608
10608
|
];
|
|
10609
|
-
// -----
|
|
10610
|
-
type
|
|
10609
|
+
// ----- tailwind/no-arbitrary-value -----
|
|
10610
|
+
type TailwindNoArbitraryValue = [
|
|
10611
10611
|
] | [
|
|
10612
10612
|
{
|
|
10613
10613
|
callees?: string[];
|
|
@@ -10619,8 +10619,8 @@ type TailwindcssNoArbitraryValue = [
|
|
|
10619
10619
|
[k: string]: unknown | undefined;
|
|
10620
10620
|
}
|
|
10621
10621
|
];
|
|
10622
|
-
// -----
|
|
10623
|
-
type
|
|
10622
|
+
// ----- tailwind/no-contradicting-classname -----
|
|
10623
|
+
type TailwindNoContradictingClassname = [
|
|
10624
10624
|
] | [
|
|
10625
10625
|
{
|
|
10626
10626
|
callees?: string[];
|
|
@@ -10632,8 +10632,8 @@ type TailwindcssNoContradictingClassname = [
|
|
|
10632
10632
|
[k: string]: unknown | undefined;
|
|
10633
10633
|
}
|
|
10634
10634
|
];
|
|
10635
|
-
// -----
|
|
10636
|
-
type
|
|
10635
|
+
// ----- tailwind/no-custom-classname -----
|
|
10636
|
+
type TailwindNoCustomClassname = [
|
|
10637
10637
|
] | [
|
|
10638
10638
|
{
|
|
10639
10639
|
callees?: string[];
|
|
@@ -10648,8 +10648,8 @@ type TailwindcssNoCustomClassname = [
|
|
|
10648
10648
|
[k: string]: unknown | undefined;
|
|
10649
10649
|
}
|
|
10650
10650
|
];
|
|
10651
|
-
// -----
|
|
10652
|
-
type
|
|
10651
|
+
// ----- tailwind/no-unnecessary-arbitrary-value -----
|
|
10652
|
+
type TailwindNoUnnecessaryArbitraryValue = [
|
|
10653
10653
|
] | [
|
|
10654
10654
|
{
|
|
10655
10655
|
callees?: string[];
|
|
@@ -14498,7 +14498,9 @@ type OptionsStylistic = {
|
|
|
14498
14498
|
type RequiredOptionsStylistic = {
|
|
14499
14499
|
stylistic: Required<StylisticConfig> | false;
|
|
14500
14500
|
};
|
|
14501
|
-
type StylisticConfig = {
|
|
14501
|
+
type StylisticConfig = {
|
|
14502
|
+
printWidth?: number;
|
|
14503
|
+
} & Pick<StylisticCustomizeOptions, "indent" | "quotes" | "jsx" | "semi">;
|
|
14502
14504
|
type OptionsOverrides = {
|
|
14503
14505
|
overrides?: FlatConfigItem["rules"];
|
|
14504
14506
|
};
|
|
@@ -14664,7 +14666,7 @@ declare const StylisticConfigDefaults: Required<StylisticConfig>;
|
|
|
14664
14666
|
declare function stylistic(options: Readonly<Required<{
|
|
14665
14667
|
stylistic: Required<StylisticConfig>;
|
|
14666
14668
|
} & OptionsOverrides & OptionsHasTypeScript>>): Promise<FlatConfigItem[]>;
|
|
14667
|
-
declare function tailwind(options: Readonly<Required<OptionsTailwindCSS
|
|
14669
|
+
declare function tailwind(options: Readonly<Required<OptionsTailwindCSS> & RequiredOptionsStylistic>): Promise<FlatConfigItem[]>;
|
|
14668
14670
|
declare function test(options: Readonly<Required<OptionsFiles & OptionsOverrides>>): Promise<FlatConfigItem[]>;
|
|
14669
14671
|
declare function toml(options: Readonly<Required<OptionsOverrides & RequiredOptionsStylistic & OptionsFiles>>): Promise<FlatConfigItem[]>;
|
|
14670
14672
|
declare const defaultFilesTypesAware: string[];
|
package/dist/index.mjs
CHANGED
|
@@ -206,10 +206,10 @@ async function formatters(opts, stylistic) {
|
|
|
206
206
|
if (options.slidev !== false && options.slidev !== undefined && options.markdown !== true) {
|
|
207
207
|
throw new Error("`slidev` option only works when `markdown` is enabled with `prettier`");
|
|
208
208
|
}
|
|
209
|
-
const { indent, quotes, semi } = stylistic;
|
|
209
|
+
const { indent, printWidth, quotes, semi } = stylistic;
|
|
210
210
|
const prettierOptions = Object.assign({
|
|
211
211
|
endOfLine: "lf",
|
|
212
|
-
printWidth: 120,
|
|
212
|
+
printWidth: printWidth ?? 120,
|
|
213
213
|
semi: semi ?? true,
|
|
214
214
|
singleQuote: quotes === "single",
|
|
215
215
|
tabWidth: typeof indent === "number" ? indent : 2,
|
|
@@ -2462,6 +2462,7 @@ const StylisticConfigDefaults = {
|
|
|
2462
2462
|
jsx: true,
|
|
2463
2463
|
quotes: "double",
|
|
2464
2464
|
semi: true,
|
|
2465
|
+
printWidth: 120,
|
|
2465
2466
|
};
|
|
2466
2467
|
async function stylistic(options) {
|
|
2467
2468
|
const { stylistic: { indent, jsx, quotes, semi }, overrides, typescript, } = options;
|
|
@@ -2694,7 +2695,7 @@ async function stylistic(options) {
|
|
|
2694
2695
|
}
|
|
2695
2696
|
|
|
2696
2697
|
async function tailwind(options) {
|
|
2697
|
-
const { overrides } = options;
|
|
2698
|
+
const { overrides, stylistic } = options;
|
|
2698
2699
|
const [pluginTailwindCSS, pluginReadableTailwind] = (await loadPackages([
|
|
2699
2700
|
"eslint-plugin-tailwindcss",
|
|
2700
2701
|
"eslint-plugin-readable-tailwind",
|
|
@@ -2703,19 +2704,30 @@ async function tailwind(options) {
|
|
|
2703
2704
|
{
|
|
2704
2705
|
name: "js:tailwindcss",
|
|
2705
2706
|
plugins: {
|
|
2706
|
-
|
|
2707
|
-
"
|
|
2707
|
+
tailwind: pluginTailwindCSS,
|
|
2708
|
+
"tailwind-readable": pluginReadableTailwind,
|
|
2708
2709
|
},
|
|
2709
2710
|
rules: {
|
|
2710
|
-
"
|
|
2711
|
-
"
|
|
2712
|
-
"
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2711
|
+
"tailwind/no-contradicting-classname": "error",
|
|
2712
|
+
"tailwind/no-arbitrary-value": "off",
|
|
2713
|
+
"tailwind/no-custom-classname": "off",
|
|
2714
|
+
...(stylistic === false
|
|
2715
|
+
? {}
|
|
2716
|
+
: {
|
|
2717
|
+
"tailwind/classnames-order": "warn",
|
|
2718
|
+
"tailwind/enforces-negative-arbitrary-values": "warn",
|
|
2719
|
+
"tailwind/enforces-shorthand": "warn",
|
|
2720
|
+
"tailwind/no-unnecessary-arbitrary-value": "warn",
|
|
2721
|
+
"tailwind-readable/multiline": [
|
|
2722
|
+
"warn",
|
|
2723
|
+
{
|
|
2724
|
+
group: "newLine",
|
|
2725
|
+
indent: stylistic.indent,
|
|
2726
|
+
printWidth: stylistic.printWidth,
|
|
2727
|
+
},
|
|
2728
|
+
],
|
|
2729
|
+
"tailwind-readable/no-unnecessary-whitespace": "warn",
|
|
2730
|
+
}),
|
|
2719
2731
|
...overrides,
|
|
2720
2732
|
},
|
|
2721
2733
|
},
|
|
@@ -3122,21 +3134,21 @@ async function typescript(options) {
|
|
|
3122
3134
|
modifiers: ["destructured"],
|
|
3123
3135
|
},
|
|
3124
3136
|
{
|
|
3125
|
-
selector: "
|
|
3137
|
+
selector: ["autoAccessor", "parameterProperty", "property"],
|
|
3126
3138
|
filter: { regex: "^[A-Z0-9_]+$", match: true },
|
|
3127
3139
|
format: ["UPPER_CASE"],
|
|
3128
3140
|
leadingUnderscore: "forbid",
|
|
3129
3141
|
trailingUnderscore: "forbid",
|
|
3130
3142
|
},
|
|
3131
3143
|
{
|
|
3132
|
-
selector: "
|
|
3144
|
+
selector: ["autoAccessor", "parameterProperty", "property"],
|
|
3133
3145
|
format: ["camelCase", "PascalCase"],
|
|
3134
3146
|
prefix: ["m_", "M_"],
|
|
3135
3147
|
leadingUnderscore: "forbid",
|
|
3136
3148
|
trailingUnderscore: "forbid",
|
|
3137
3149
|
},
|
|
3138
3150
|
{
|
|
3139
|
-
selector: "
|
|
3151
|
+
selector: ["autoAccessor", "parameterProperty", "property"],
|
|
3140
3152
|
filter: { regex: "_[^_]+", match: true },
|
|
3141
3153
|
format: ["camelCase", "PascalCase"],
|
|
3142
3154
|
modifiers: ["readonly"],
|
|
@@ -3145,7 +3157,7 @@ async function typescript(options) {
|
|
|
3145
3157
|
trailingUnderscore: "forbid",
|
|
3146
3158
|
},
|
|
3147
3159
|
{
|
|
3148
|
-
selector: "
|
|
3160
|
+
selector: ["autoAccessor", "parameterProperty", "property"],
|
|
3149
3161
|
format: ["camelCase", "PascalCase", "UPPER_CASE"],
|
|
3150
3162
|
modifiers: ["readonly"],
|
|
3151
3163
|
leadingUnderscore: "allow",
|
|
@@ -3743,6 +3755,7 @@ async function rsEslint(options, ...userConfigs) {
|
|
|
3743
3755
|
}
|
|
3744
3756
|
if (tailwindOptions !== false) {
|
|
3745
3757
|
m_configs.push(tailwind({
|
|
3758
|
+
stylistic: stylisticOptions,
|
|
3746
3759
|
overrides: getOverrides(options, "tailwind"),
|
|
3747
3760
|
}));
|
|
3748
3761
|
}
|