eslint-plugin-better-tailwindcss 4.0.0 → 4.0.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/lib/api/types.d.ts +2 -1
- package/lib/api/types.d.ts.map +1 -1
- package/lib/api/types.js +1 -1
- package/lib/api/types.js.map +1 -1
- package/lib/configs/config.d.ts +1090 -19
- package/lib/configs/config.d.ts.map +1 -1
- package/lib/configs/config.js +29 -39
- package/lib/configs/config.js.map +1 -1
- package/lib/options/descriptions.d.ts +13 -13
- package/lib/options/descriptions.js +2 -2
- package/lib/options/descriptions.js.map +1 -1
- package/lib/options/schemas/attributes.d.ts +10 -10
- package/lib/options/schemas/attributes.d.ts.map +1 -1
- package/lib/options/schemas/attributes.js +2 -2
- package/lib/options/schemas/attributes.js.map +1 -1
- package/lib/options/schemas/callees.d.ts +10 -10
- package/lib/options/schemas/callees.d.ts.map +1 -1
- package/lib/options/schemas/callees.js +2 -2
- package/lib/options/schemas/callees.js.map +1 -1
- package/lib/options/schemas/common.d.ts +6 -6
- package/lib/options/schemas/common.js +7 -7
- package/lib/options/schemas/common.js.map +1 -1
- package/lib/options/schemas/matchers.d.ts +3 -3
- package/lib/options/schemas/matchers.d.ts.map +1 -1
- package/lib/options/schemas/matchers.js +4 -4
- package/lib/options/schemas/matchers.js.map +1 -1
- package/lib/options/schemas/tags.d.ts +10 -10
- package/lib/options/schemas/tags.d.ts.map +1 -1
- package/lib/options/schemas/tags.js +2 -2
- package/lib/options/schemas/tags.js.map +1 -1
- package/lib/options/schemas/variables.d.ts +10 -10
- package/lib/options/schemas/variables.d.ts.map +1 -1
- package/lib/options/schemas/variables.js +2 -2
- package/lib/options/schemas/variables.js.map +1 -1
- package/lib/parsers/angular.js.map +1 -1
- package/lib/rules/enforce-canonical-classes.d.ts +82 -50
- package/lib/rules/enforce-canonical-classes.d.ts.map +1 -1
- package/lib/rules/enforce-canonical-classes.js +2 -2
- package/lib/rules/enforce-canonical-classes.js.map +1 -1
- package/lib/rules/enforce-consistent-class-order.d.ts +83 -52
- package/lib/rules/enforce-consistent-class-order.d.ts.map +1 -1
- package/lib/rules/enforce-consistent-class-order.js +2 -2
- package/lib/rules/enforce-consistent-class-order.js.map +1 -1
- package/lib/rules/enforce-consistent-important-position.d.ts +79 -48
- package/lib/rules/enforce-consistent-important-position.d.ts.map +1 -1
- package/lib/rules/enforce-consistent-important-position.js +2 -2
- package/lib/rules/enforce-consistent-important-position.js.map +1 -1
- package/lib/rules/enforce-consistent-line-wrapping.d.ts +87 -55
- package/lib/rules/enforce-consistent-line-wrapping.d.ts.map +1 -1
- package/lib/rules/enforce-consistent-line-wrapping.js +2 -2
- package/lib/rules/enforce-consistent-line-wrapping.js.map +1 -1
- package/lib/rules/enforce-consistent-variable-syntax.d.ts +79 -48
- package/lib/rules/enforce-consistent-variable-syntax.d.ts.map +1 -1
- package/lib/rules/enforce-consistent-variable-syntax.js +3 -3
- package/lib/rules/enforce-consistent-variable-syntax.js.map +1 -1
- package/lib/rules/enforce-shorthand-classes.d.ts +81 -49
- package/lib/rules/enforce-shorthand-classes.d.ts.map +1 -1
- package/lib/rules/no-conflicting-classes.d.ts +79 -48
- package/lib/rules/no-conflicting-classes.d.ts.map +1 -1
- package/lib/rules/no-deprecated-classes.d.ts +81 -49
- package/lib/rules/no-deprecated-classes.d.ts.map +1 -1
- package/lib/rules/no-duplicate-classes.d.ts +79 -48
- package/lib/rules/no-duplicate-classes.d.ts.map +1 -1
- package/lib/rules/no-restricted-classes.d.ts +79 -50
- package/lib/rules/no-restricted-classes.d.ts.map +1 -1
- package/lib/rules/no-restricted-classes.js +3 -3
- package/lib/rules/no-restricted-classes.js.map +1 -1
- package/lib/rules/no-unknown-classes.d.ts +79 -48
- package/lib/rules/no-unknown-classes.d.ts.map +1 -1
- package/lib/rules/no-unknown-classes.js +2 -2
- package/lib/rules/no-unknown-classes.js.map +1 -1
- package/lib/rules/no-unnecessary-whitespace.d.ts +79 -48
- package/lib/rules/no-unnecessary-whitespace.d.ts.map +1 -1
- package/lib/rules/no-unnecessary-whitespace.js +2 -2
- package/lib/rules/no-unnecessary-whitespace.js.map +1 -1
- package/lib/tailwindcss/canonical-classes.async.v4.d.ts.map +1 -1
- package/lib/tailwindcss/canonical-classes.async.v4.js +11 -18
- package/lib/tailwindcss/canonical-classes.async.v4.js.map +1 -1
- package/lib/types/rule.d.ts +9 -7
- package/lib/types/rule.d.ts.map +1 -1
- package/lib/utils/lint.d.ts.map +1 -1
- package/lib/utils/lint.js +3 -2
- package/lib/utils/lint.js.map +1 -1
- package/lib/utils/rule.d.ts +31 -2
- package/lib/utils/rule.d.ts.map +1 -1
- package/lib/utils/rule.js +3 -2
- package/lib/utils/rule.js.map +1 -1
- package/package.json +12 -12
|
@@ -1,51 +1,80 @@
|
|
|
1
|
-
export declare const noRestrictedClasses:
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
1
|
+
export declare const noRestrictedClasses: {
|
|
2
|
+
category: "correctness";
|
|
3
|
+
messages: Record<string, string> | undefined;
|
|
4
|
+
name: "no-restricted-classes";
|
|
5
|
+
readonly options: any;
|
|
6
|
+
rule: {
|
|
7
|
+
create: (ctx: import("node_modules/@eslint/core/dist/cjs/types.cjs").RuleContext<{
|
|
8
|
+
LangOptions: import("eslint").Linter.LanguageOptions;
|
|
9
|
+
Code: import("eslint").SourceCode;
|
|
10
|
+
RuleOptions: [Required<{
|
|
11
|
+
rootFontSize?: number | undefined;
|
|
12
|
+
detectComponentClasses: boolean;
|
|
13
|
+
tsconfig?: string | undefined;
|
|
14
|
+
tailwindConfig?: string | undefined;
|
|
15
|
+
messageStyle: "visual" | "compact" | "raw";
|
|
16
|
+
entryPoint?: string | undefined;
|
|
17
|
+
tags: (string | [string, ({
|
|
18
|
+
match: import("../types/rule.js").MatcherType.String;
|
|
19
|
+
} | {
|
|
20
|
+
match: import("../types/rule.js").MatcherType.ObjectKey;
|
|
21
|
+
pathPattern?: string | undefined;
|
|
22
|
+
} | {
|
|
23
|
+
match: import("../types/rule.js").MatcherType.ObjectValue;
|
|
24
|
+
pathPattern?: string | undefined;
|
|
25
|
+
})[]])[];
|
|
26
|
+
variables: (string | [string, ({
|
|
27
|
+
match: import("../types/rule.js").MatcherType.String;
|
|
28
|
+
} | {
|
|
29
|
+
match: import("../types/rule.js").MatcherType.ObjectKey;
|
|
30
|
+
pathPattern?: string | undefined;
|
|
31
|
+
} | {
|
|
32
|
+
match: import("../types/rule.js").MatcherType.ObjectValue;
|
|
33
|
+
pathPattern?: string | undefined;
|
|
34
|
+
})[]])[];
|
|
35
|
+
attributes: (string | [string, ({
|
|
36
|
+
match: import("../types/rule.js").MatcherType.String;
|
|
37
|
+
} | {
|
|
38
|
+
match: import("../types/rule.js").MatcherType.ObjectKey;
|
|
39
|
+
pathPattern?: string | undefined;
|
|
40
|
+
} | {
|
|
41
|
+
match: import("../types/rule.js").MatcherType.ObjectValue;
|
|
42
|
+
pathPattern?: string | undefined;
|
|
43
|
+
})[]])[];
|
|
44
|
+
callees: (string | [string, ({
|
|
45
|
+
match: import("../types/rule.js").MatcherType.String;
|
|
46
|
+
} | {
|
|
47
|
+
match: import("../types/rule.js").MatcherType.ObjectKey;
|
|
48
|
+
pathPattern?: string | undefined;
|
|
49
|
+
} | {
|
|
50
|
+
match: import("../types/rule.js").MatcherType.ObjectValue;
|
|
51
|
+
pathPattern?: string | undefined;
|
|
52
|
+
})[]])[];
|
|
53
|
+
} & {
|
|
54
|
+
restrict: (string | {
|
|
55
|
+
fix?: string | undefined;
|
|
56
|
+
message?: string | undefined;
|
|
57
|
+
pattern: string;
|
|
58
|
+
})[];
|
|
59
|
+
}>];
|
|
60
|
+
Node: import("eslint").JSSyntaxElement;
|
|
61
|
+
MessageIds: string;
|
|
62
|
+
}>) => import("eslint").Rule.RuleListener;
|
|
63
|
+
meta: {
|
|
64
|
+
messages?: Record<string, string> | undefined;
|
|
65
|
+
docs: {
|
|
66
|
+
description: string;
|
|
67
|
+
recommended: boolean;
|
|
68
|
+
url: string;
|
|
69
|
+
};
|
|
70
|
+
fixable: "code" | undefined;
|
|
71
|
+
schema: {
|
|
72
|
+
additionalProperties: false;
|
|
73
|
+
properties: Record<string, boolean | import("@valibot/to-json-schema").JsonSchema> | undefined;
|
|
74
|
+
type: "object";
|
|
75
|
+
}[];
|
|
76
|
+
type: "problem" | "layout";
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
};
|
|
51
80
|
//# sourceMappingURL=no-restricted-classes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no-restricted-classes.d.ts","sourceRoot":"","sources":["../../src/rules/no-restricted-classes.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,mBAAmB
|
|
1
|
+
{"version":3,"file":"no-restricted-classes.d.ts","sourceRoot":"","sources":["../../src/rules/no-restricted-classes.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwC9B,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { array, description,
|
|
1
|
+
import { array, description, optional, pipe, strictObject, string, union } from "valibot";
|
|
2
2
|
import { lintClasses } from "../utils/lint.js";
|
|
3
3
|
import { createRule } from "../utils/rule.js";
|
|
4
4
|
import { replacePlaceholders } from "../utils/utils.js";
|
|
@@ -9,9 +9,9 @@ export const noRestrictedClasses = createRule({
|
|
|
9
9
|
docs: "https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/no-restricted-classes.md",
|
|
10
10
|
name: "no-restricted-classes",
|
|
11
11
|
recommended: false,
|
|
12
|
-
schema:
|
|
12
|
+
schema: strictObject({
|
|
13
13
|
restrict: optional(array(union([
|
|
14
|
-
|
|
14
|
+
strictObject({
|
|
15
15
|
fix: optional(pipe(string(), description("A replacement class"))),
|
|
16
16
|
message: optional(pipe(string(), description("The message to report when a class is restricted."))),
|
|
17
17
|
pattern: pipe(string(), description("The regex pattern to match restricted classes."))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no-restricted-classes.js","sourceRoot":"","sources":["../../src/rules/no-restricted-classes.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,WAAW,EACX,
|
|
1
|
+
{"version":3,"file":"no-restricted-classes.js","sourceRoot":"","sources":["../../src/rules/no-restricted-classes.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,WAAW,EACX,QAAQ,EACR,IAAI,EACJ,YAAY,EACZ,MAAM,EACN,KAAK,EACN,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAMxE,MAAM,CAAC,MAAM,mBAAmB,GAAG,UAAU,CAAC;IAC5C,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,aAAa;I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G,OAAO,WAAW,KAAK,QAAQ,IAAI,CAAC,WAAW,CAAC,OAAO;oBACrE,CAAC,CAAC,sBAAsB,SAAS,IAAI;oBACrC,CAAC,CAAC,mBAAmB,CAAC,WAAW,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;gBAEtD,IAAG,OAAO,WAAW,KAAK,QAAQ,EAAC,CAAC;oBAClC,OAAO;wBACL,OAAO;qBACC,CAAC;gBACb,CAAC;gBAED,IAAG,WAAW,CAAC,GAAG,KAAK,SAAS,EAAC,CAAC;oBAChC,OAAO;wBACL,GAAG,EAAE,mBAAmB,CAAC,WAAW,CAAC,GAAG,EAAE,OAAO,CAAC;wBAClD,OAAO;qBACC,CAAC;gBACb,CAAC;gBAED,OAAO;oBACL,OAAO;iBACC,CAAC;YACb,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
|
|
@@ -1,49 +1,80 @@
|
|
|
1
|
-
export declare const noUnknownClasses:
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
1
|
+
export declare const noUnknownClasses: {
|
|
2
|
+
category: "correctness";
|
|
3
|
+
messages: {
|
|
4
|
+
readonly unknown: "Unknown class detected: {{ className }}";
|
|
5
|
+
} | undefined;
|
|
6
|
+
name: "no-unknown-classes";
|
|
7
|
+
readonly options: any;
|
|
8
|
+
rule: {
|
|
9
|
+
create: (ctx: import("node_modules/@eslint/core/dist/cjs/types.cjs").RuleContext<{
|
|
10
|
+
LangOptions: import("eslint").Linter.LanguageOptions;
|
|
11
|
+
Code: import("eslint").SourceCode;
|
|
12
|
+
RuleOptions: [Required<{
|
|
13
|
+
rootFontSize?: number | undefined;
|
|
14
|
+
detectComponentClasses: boolean;
|
|
15
|
+
tsconfig?: string | undefined;
|
|
16
|
+
tailwindConfig?: string | undefined;
|
|
17
|
+
messageStyle: "visual" | "compact" | "raw";
|
|
18
|
+
entryPoint?: string | undefined;
|
|
19
|
+
tags: (string | [string, ({
|
|
20
|
+
match: import("../types/rule.js").MatcherType.String;
|
|
21
|
+
} | {
|
|
22
|
+
match: import("../types/rule.js").MatcherType.ObjectKey;
|
|
23
|
+
pathPattern?: string | undefined;
|
|
24
|
+
} | {
|
|
25
|
+
match: import("../types/rule.js").MatcherType.ObjectValue;
|
|
26
|
+
pathPattern?: string | undefined;
|
|
27
|
+
})[]])[];
|
|
28
|
+
variables: (string | [string, ({
|
|
29
|
+
match: import("../types/rule.js").MatcherType.String;
|
|
30
|
+
} | {
|
|
31
|
+
match: import("../types/rule.js").MatcherType.ObjectKey;
|
|
32
|
+
pathPattern?: string | undefined;
|
|
33
|
+
} | {
|
|
34
|
+
match: import("../types/rule.js").MatcherType.ObjectValue;
|
|
35
|
+
pathPattern?: string | undefined;
|
|
36
|
+
})[]])[];
|
|
37
|
+
attributes: (string | [string, ({
|
|
38
|
+
match: import("../types/rule.js").MatcherType.String;
|
|
39
|
+
} | {
|
|
40
|
+
match: import("../types/rule.js").MatcherType.ObjectKey;
|
|
41
|
+
pathPattern?: string | undefined;
|
|
42
|
+
} | {
|
|
43
|
+
match: import("../types/rule.js").MatcherType.ObjectValue;
|
|
44
|
+
pathPattern?: string | undefined;
|
|
45
|
+
})[]])[];
|
|
46
|
+
callees: (string | [string, ({
|
|
47
|
+
match: import("../types/rule.js").MatcherType.String;
|
|
48
|
+
} | {
|
|
49
|
+
match: import("../types/rule.js").MatcherType.ObjectKey;
|
|
50
|
+
pathPattern?: string | undefined;
|
|
51
|
+
} | {
|
|
52
|
+
match: import("../types/rule.js").MatcherType.ObjectValue;
|
|
53
|
+
pathPattern?: string | undefined;
|
|
54
|
+
})[]])[];
|
|
55
|
+
} & {
|
|
56
|
+
ignore: string[];
|
|
57
|
+
}>];
|
|
58
|
+
Node: import("eslint").JSSyntaxElement;
|
|
59
|
+
MessageIds: "unknown";
|
|
60
|
+
}>) => import("eslint").Rule.RuleListener;
|
|
61
|
+
meta: {
|
|
62
|
+
messages?: {
|
|
63
|
+
readonly unknown: "Unknown class detected: {{ className }}";
|
|
64
|
+
} | undefined;
|
|
65
|
+
docs: {
|
|
66
|
+
description: string;
|
|
67
|
+
recommended: boolean;
|
|
68
|
+
url: string;
|
|
69
|
+
};
|
|
70
|
+
fixable: "code" | undefined;
|
|
71
|
+
schema: {
|
|
72
|
+
additionalProperties: false;
|
|
73
|
+
properties: Record<string, boolean | import("@valibot/to-json-schema").JsonSchema> | undefined;
|
|
74
|
+
type: "object";
|
|
75
|
+
}[];
|
|
76
|
+
type: "problem" | "layout";
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
};
|
|
49
80
|
//# sourceMappingURL=no-unknown-classes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no-unknown-classes.d.ts","sourceRoot":"","sources":["../../src/rules/no-unknown-classes.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,gBAAgB
|
|
1
|
+
{"version":3,"file":"no-unknown-classes.d.ts","sourceRoot":"","sources":["../../src/rules/no-unknown-classes.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoC3B,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { array, description,
|
|
1
|
+
import { array, description, optional, pipe, strictObject, string } from "valibot";
|
|
2
2
|
import { createGetCustomComponentClasses, getCustomComponentClasses } from "../tailwindcss/custom-component-classes.js";
|
|
3
3
|
import { createGetPrefix, getPrefix } from "../tailwindcss/prefix.js";
|
|
4
4
|
import { createGetUnknownClasses, getUnknownClasses } from "../tailwindcss/unknown-classes.js";
|
|
@@ -17,7 +17,7 @@ export const noUnknownClasses = createRule({
|
|
|
17
17
|
messages: {
|
|
18
18
|
unknown: "Unknown class detected: {{ className }}"
|
|
19
19
|
},
|
|
20
|
-
schema:
|
|
20
|
+
schema: strictObject({
|
|
21
21
|
ignore: optional(pipe(array(string()), description("A list of classes that should be ignored by the rule.")), [])
|
|
22
22
|
}),
|
|
23
23
|
initialize: ctx => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no-unknown-classes.js","sourceRoot":"","sources":["../../src/rules/no-unknown-classes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"no-unknown-classes.js","sourceRoot":"","sources":["../../src/rules/no-unknown-classes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEnF,OAAO,EACL,+BAA+B,EAC/B,yBAAyB,EAC1B,MAAM,4DAA4D,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AACtF,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,mDAAmD,CAAC;AAC/G,OAAO,EAAE,KAAK,EAAE,MAAM,qCAAqC,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,M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BAAsB,EAAE,GAAG,GAAG,CAAC,OAAO,CAAC;IAE/C,IAAG,CAAC,sBAAsB,EAAC,CAAC;QAC1B,OAAO;IACT,CAAC;IAED,MAAM,EAAE,sBAAsB,EAAE,GAAG,yBAAyB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;IACzE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;IAEjD,OAAO,sBAAsB,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,IAAI,cAAc,CAAC,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC,WAAW,cAAc,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;AAC9I,CAAC"}
|
|
@@ -1,49 +1,80 @@
|
|
|
1
|
-
export declare const noUnnecessaryWhitespace:
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
1
|
+
export declare const noUnnecessaryWhitespace: {
|
|
2
|
+
category: "stylistic";
|
|
3
|
+
messages: {
|
|
4
|
+
readonly unnecessary: "Unnecessary whitespace.";
|
|
5
|
+
} | undefined;
|
|
6
|
+
name: "no-unnecessary-whitespace";
|
|
7
|
+
readonly options: any;
|
|
8
|
+
rule: {
|
|
9
|
+
create: (ctx: import("node_modules/@eslint/core/dist/cjs/types.cjs").RuleContext<{
|
|
10
|
+
LangOptions: import("eslint").Linter.LanguageOptions;
|
|
11
|
+
Code: import("eslint").SourceCode;
|
|
12
|
+
RuleOptions: [Required<{
|
|
13
|
+
rootFontSize?: number | undefined;
|
|
14
|
+
detectComponentClasses: boolean;
|
|
15
|
+
tsconfig?: string | undefined;
|
|
16
|
+
tailwindConfig?: string | undefined;
|
|
17
|
+
messageStyle: "visual" | "compact" | "raw";
|
|
18
|
+
entryPoint?: string | undefined;
|
|
19
|
+
tags: (string | [string, ({
|
|
20
|
+
match: import("../types/rule.js").MatcherType.String;
|
|
21
|
+
} | {
|
|
22
|
+
match: import("../types/rule.js").MatcherType.ObjectKey;
|
|
23
|
+
pathPattern?: string | undefined;
|
|
24
|
+
} | {
|
|
25
|
+
match: import("../types/rule.js").MatcherType.ObjectValue;
|
|
26
|
+
pathPattern?: string | undefined;
|
|
27
|
+
})[]])[];
|
|
28
|
+
variables: (string | [string, ({
|
|
29
|
+
match: import("../types/rule.js").MatcherType.String;
|
|
30
|
+
} | {
|
|
31
|
+
match: import("../types/rule.js").MatcherType.ObjectKey;
|
|
32
|
+
pathPattern?: string | undefined;
|
|
33
|
+
} | {
|
|
34
|
+
match: import("../types/rule.js").MatcherType.ObjectValue;
|
|
35
|
+
pathPattern?: string | undefined;
|
|
36
|
+
})[]])[];
|
|
37
|
+
attributes: (string | [string, ({
|
|
38
|
+
match: import("../types/rule.js").MatcherType.String;
|
|
39
|
+
} | {
|
|
40
|
+
match: import("../types/rule.js").MatcherType.ObjectKey;
|
|
41
|
+
pathPattern?: string | undefined;
|
|
42
|
+
} | {
|
|
43
|
+
match: import("../types/rule.js").MatcherType.ObjectValue;
|
|
44
|
+
pathPattern?: string | undefined;
|
|
45
|
+
})[]])[];
|
|
46
|
+
callees: (string | [string, ({
|
|
47
|
+
match: import("../types/rule.js").MatcherType.String;
|
|
48
|
+
} | {
|
|
49
|
+
match: import("../types/rule.js").MatcherType.ObjectKey;
|
|
50
|
+
pathPattern?: string | undefined;
|
|
51
|
+
} | {
|
|
52
|
+
match: import("../types/rule.js").MatcherType.ObjectValue;
|
|
53
|
+
pathPattern?: string | undefined;
|
|
54
|
+
})[]])[];
|
|
55
|
+
} & {
|
|
56
|
+
allowMultiline: boolean;
|
|
57
|
+
}>];
|
|
58
|
+
Node: import("eslint").JSSyntaxElement;
|
|
59
|
+
MessageIds: "unnecessary";
|
|
60
|
+
}>) => import("eslint").Rule.RuleListener;
|
|
61
|
+
meta: {
|
|
62
|
+
messages?: {
|
|
63
|
+
readonly unnecessary: "Unnecessary whitespace.";
|
|
64
|
+
} | undefined;
|
|
65
|
+
docs: {
|
|
66
|
+
description: string;
|
|
67
|
+
recommended: boolean;
|
|
68
|
+
url: string;
|
|
69
|
+
};
|
|
70
|
+
fixable: "code" | undefined;
|
|
71
|
+
schema: {
|
|
72
|
+
additionalProperties: false;
|
|
73
|
+
properties: Record<string, boolean | import("@valibot/to-json-schema").JsonSchema> | undefined;
|
|
74
|
+
type: "object";
|
|
75
|
+
}[];
|
|
76
|
+
type: "problem" | "layout";
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
};
|
|
49
80
|
//# sourceMappingURL=no-unnecessary-whitespace.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no-unnecessary-whitespace.d.ts","sourceRoot":"","sources":["../../src/rules/no-unnecessary-whitespace.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,uBAAuB
|
|
1
|
+
{"version":3,"file":"no-unnecessary-whitespace.d.ts","sourceRoot":"","sources":["../../src/rules/no-unnecessary-whitespace.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoBlC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { boolean, description,
|
|
1
|
+
import { boolean, description, optional, pipe, strictObject } from "valibot";
|
|
2
2
|
import { createRule } from "../utils/rule.js";
|
|
3
3
|
import { splitClasses, splitWhitespaces } from "../utils/utils.js";
|
|
4
4
|
export const noUnnecessaryWhitespace = createRule({
|
|
@@ -11,7 +11,7 @@ export const noUnnecessaryWhitespace = createRule({
|
|
|
11
11
|
messages: {
|
|
12
12
|
unnecessary: "Unnecessary whitespace."
|
|
13
13
|
},
|
|
14
|
-
schema:
|
|
14
|
+
schema: strictObject({
|
|
15
15
|
allowMultiline: optional(pipe(boolean(), description("Allow multi-line class declarations. If this option is disabled, template literal strings will be collapsed into a single line string wherever possible. Must be set to `true` when used in combination with [better-tailwindcss/enforce-consistent-line-wrapping](./enforce-consistent-line-wrapping.md).")), true)
|
|
16
16
|
}),
|
|
17
17
|
lintLiterals: (ctx, literals) => lintLiterals(ctx, literals)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no-unnecessary-whitespace.js","sourceRoot":"","sources":["../../src/rules/no-unnecessary-whitespace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"no-unnecessary-whitespace.js","sourceRoot":"","sources":["../../src/rules/no-unnecessary-whitespace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE7E,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAMnF,MAAM,CAAC,MAAM,uBAAuB,GAAG,UAAU,CAAC;IAChD,OAAO,EAAE,IAAI;IACb,QAAQ,EAA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oBAC/E,OAAO,CAAC,cAAc,IAAI,OAAO,CAAC,aAAa,IAAI,WAAW,IAAI,CAAC,YAAY;oBAC/E,OAAO,CAAC,cAAc,IAAI,OAAO,CAAC,aAAa,IAAI,OAAO,CAAC,aAAa,CACzE,EACF,CAAC;gBACA,IAAG,UAAU,CAAC,MAAM,IAAI,CAAC,EAAC,CAAC;oBACzB,SAAS;gBACX,CAAC;gBAED,GAAG,CAAC,MAAM,CAAC;oBACT,GAAG,EAAE,GAAG;oBACR,EAAE,EAAE,aAAa;oBACjB,KAAK,EAAE;wBACL,YAAY,GAAG,UAAU;wBACzB,YAAY,GAAG,QAAQ;qBACxB;iBACF,CAAC,CAAC;gBAEH,SAAS;YACX,CAAC;YAED,iCAAiC;YACjC,IAAG,YAAY,IAAI,WAAW,EAAC,CAAC;gBAC9B,IAAG,UAAU,KAAK,EAAE,EAAC,CAAC;oBACpB,SAAS;gBACX,CAAC;gBAED,GAAG,CAAC,MAAM,CAAC;oBACT,GAAG,EAAE,EAAE;oBACP,EAAE,EAAE,aAAa;oBACjB,KAAK,EAAE;wBACL,YAAY,GAAG,UAAU;wBACzB,YAAY,GAAG,QAAQ;qBACxB;iBACF,CAAC,CAAC;gBAEH,SAAS;YACX,CAAC;QACH,CAAC;IAEH,CAAC;AAEH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canonical-classes.async.v4.d.ts","sourceRoot":"","sources":["../../src/tailwindcss/canonical-classes.async.v4.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAGtF,wBAAgB,mBAAmB,CAAC,eAAe,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,qBAAqB,GAAG,gBAAgB,
|
|
1
|
+
{"version":3,"file":"canonical-classes.async.v4.d.ts","sourceRoot":"","sources":["../../src/tailwindcss/canonical-classes.async.v4.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAGtF,wBAAgB,mBAAmB,CAAC,eAAe,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,qBAAqB,GAAG,gBAAgB,CA4D7H"}
|
|
@@ -32,24 +32,17 @@ export function getCanonicalClasses(tailwindContext, classes, options) {
|
|
|
32
32
|
if (canonicalClasses.length === 0) {
|
|
33
33
|
return result;
|
|
34
34
|
}
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
input: originalClasses,
|
|
47
|
-
output: canonicalClass
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
originalClassesToCheck.length = 0;
|
|
51
|
-
break;
|
|
52
|
-
}
|
|
35
|
+
for (const canonicalClass of canonicalClasses) {
|
|
36
|
+
const necessaryClasses = removedClasses.filter(removedClass => {
|
|
37
|
+
const subset = removedClasses.filter(className => className !== removedClass);
|
|
38
|
+
const subsetCanonical = tailwindContext.canonicalizeCandidates(subset, options);
|
|
39
|
+
return !subsetCanonical.includes(canonicalClass);
|
|
40
|
+
});
|
|
41
|
+
for (const originalClass of necessaryClasses) {
|
|
42
|
+
result[originalClass] = {
|
|
43
|
+
input: necessaryClasses,
|
|
44
|
+
output: canonicalClass
|
|
45
|
+
};
|
|
53
46
|
}
|
|
54
47
|
}
|
|
55
48
|
return result;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canonical-classes.async.v4.js","sourceRoot":"","sources":["../../src/tailwindcss/canonical-classes.async.v4.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAKlE,MAAM,UAAU,mBAAmB,CAAC,eAAoB,EAAE,OAAiB,EAAE,OAA8B;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ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { JSRuleDefinition } from "eslint";
|
|
2
|
-
import type { BaseIssue, BaseSchema, Default, InferOutput,
|
|
2
|
+
import type { BaseIssue, BaseSchema, Default, InferOutput, OptionalSchema, StrictObjectSchema } from "valibot";
|
|
3
3
|
import type { CommonOptions } from "../options/descriptions.js";
|
|
4
4
|
import type { Literal } from "./ast.js";
|
|
5
5
|
import type { Warning } from "./async.js";
|
|
@@ -38,13 +38,14 @@ export type TailwindConfig = {
|
|
|
38
38
|
export type TSConfig = {
|
|
39
39
|
tsconfig?: string;
|
|
40
40
|
};
|
|
41
|
-
export type Schema =
|
|
41
|
+
export type Schema = StrictObjectSchema<Record<string, OptionalSchema<BaseSchema<unknown, unknown, BaseIssue<unknown>>, Default<BaseSchema<unknown, unknown, BaseIssue<unknown>>, undefined>>>, undefined>;
|
|
42
42
|
export type JsonSchema<RawSchema extends Schema> = InferOutput<RawSchema>;
|
|
43
|
-
export
|
|
43
|
+
export type RuleCategory = "correctness" | "stylistic";
|
|
44
|
+
export interface CreateRuleOptions<Name extends string, Messages extends Record<string, string>, OptionsSchema extends Schema = Schema, Options extends Record<string, any> = CommonOptions & JsonSchema<OptionsSchema>, Category extends RuleCategory = RuleCategory> {
|
|
44
45
|
/** Whether the rule should automatically fix problems. */
|
|
45
46
|
autofix: boolean;
|
|
46
47
|
/** The category of the rule. */
|
|
47
|
-
category:
|
|
48
|
+
category: Category;
|
|
48
49
|
/** A brief description of the rule. */
|
|
49
50
|
description: string;
|
|
50
51
|
/** The URL to the rule documentation. */
|
|
@@ -52,7 +53,7 @@ export interface CreateRuleOptions<Messages extends Record<string, string>, Opti
|
|
|
52
53
|
/** Lint the literals in the given context. */
|
|
53
54
|
lintLiterals: (ctx: RuleContext<Messages, Options>, literals: Literal[]) => void;
|
|
54
55
|
/** The name of the rule. */
|
|
55
|
-
name:
|
|
56
|
+
name: Name;
|
|
56
57
|
/** Whether the rule is enabled in the recommended configs. */
|
|
57
58
|
recommended: boolean;
|
|
58
59
|
initialize?: (ctx: RuleContext<Messages, Options>) => void;
|
|
@@ -61,9 +62,10 @@ export interface CreateRuleOptions<Messages extends Record<string, string>, Opti
|
|
|
61
62
|
/** The schema for the rule options. */
|
|
62
63
|
schema?: OptionsSchema;
|
|
63
64
|
}
|
|
64
|
-
export interface ESLintRule<Messages extends Record<string, string> = Record<string, string>, Options extends Record<string, any> = Record<string, any
|
|
65
|
+
export interface ESLintRule<Name extends string = string, Messages extends Record<string, string> = Record<string, string>, Options extends Record<string, any> = Record<string, any>, Category extends RuleCategory = RuleCategory> {
|
|
66
|
+
category: Category;
|
|
65
67
|
messages: Messages | undefined;
|
|
66
|
-
name:
|
|
68
|
+
name: Name;
|
|
67
69
|
get options(): Options;
|
|
68
70
|
rule: JSRuleDefinition<{
|
|
69
71
|
MessageIds: keyof Messages & string;
|