eslint-plugin-better-tailwindcss 4.2.0 → 4.3.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/README.md +1 -1
- package/lib/api/defaults.d.ts +84 -14
- package/lib/api/defaults.d.ts.map +1 -1
- package/lib/api/defaults.js +25 -5
- package/lib/api/defaults.js.map +1 -1
- package/lib/api/types.d.ts +2 -2
- 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 +1754 -194
- package/lib/configs/config.d.ts.map +1 -1
- package/lib/options/callees/cc.d.ts +28 -12
- package/lib/options/callees/cc.d.ts.map +1 -1
- package/lib/options/callees/cc.js +15 -13
- package/lib/options/callees/cc.js.map +1 -1
- package/lib/options/callees/clb.d.ts +33 -17
- package/lib/options/callees/clb.d.ts.map +1 -1
- package/lib/options/callees/clb.js +25 -22
- package/lib/options/callees/clb.js.map +1 -1
- package/lib/options/callees/clsx.d.ts +28 -12
- package/lib/options/callees/clsx.d.ts.map +1 -1
- package/lib/options/callees/clsx.js +15 -13
- package/lib/options/callees/clsx.js.map +1 -1
- package/lib/options/callees/cn.d.ts +28 -12
- package/lib/options/callees/cn.d.ts.map +1 -1
- package/lib/options/callees/cn.js +15 -13
- package/lib/options/callees/cn.js.map +1 -1
- package/lib/options/callees/cnb.d.ts +28 -12
- package/lib/options/callees/cnb.d.ts.map +1 -1
- package/lib/options/callees/cnb.js +15 -13
- package/lib/options/callees/cnb.js.map +1 -1
- package/lib/options/callees/ctl.d.ts +15 -7
- package/lib/options/callees/ctl.d.ts.map +1 -1
- package/lib/options/callees/ctl.js +8 -7
- package/lib/options/callees/ctl.js.map +1 -1
- package/lib/options/callees/cva.d.ts +38 -18
- package/lib/options/callees/cva.d.ts.map +1 -1
- package/lib/options/callees/cva.js +24 -21
- package/lib/options/callees/cva.js.map +1 -1
- package/lib/options/callees/cx.d.ts +28 -12
- package/lib/options/callees/cx.d.ts.map +1 -1
- package/lib/options/callees/cx.js +15 -13
- package/lib/options/callees/cx.js.map +1 -1
- package/lib/options/callees/dcnb.d.ts +28 -12
- package/lib/options/callees/dcnb.d.ts.map +1 -1
- package/lib/options/callees/dcnb.js +15 -13
- package/lib/options/callees/dcnb.js.map +1 -1
- package/lib/options/callees/objstr.d.ts +22 -10
- package/lib/options/callees/objstr.d.ts.map +1 -1
- package/lib/options/callees/objstr.js +15 -13
- package/lib/options/callees/objstr.js.map +1 -1
- package/lib/options/callees/tv.d.ts +62 -30
- package/lib/options/callees/tv.d.ts.map +1 -1
- package/lib/options/callees/tv.js +48 -42
- package/lib/options/callees/tv.js.map +1 -1
- package/lib/options/callees/twJoin.d.ts +15 -7
- package/lib/options/callees/twJoin.d.ts.map +1 -1
- package/lib/options/callees/twJoin.js +8 -7
- package/lib/options/callees/twJoin.js.map +1 -1
- package/lib/options/callees/twMerge.d.ts +15 -7
- package/lib/options/callees/twMerge.d.ts.map +1 -1
- package/lib/options/callees/twMerge.js +8 -7
- package/lib/options/callees/twMerge.js.map +1 -1
- package/lib/options/default-options.d.ts +78 -13
- package/lib/options/default-options.d.ts.map +1 -1
- package/lib/options/default-options.js +97 -50
- package/lib/options/default-options.js.map +1 -1
- package/lib/options/descriptions.d.ts +210 -17
- package/lib/options/descriptions.d.ts.map +1 -1
- package/lib/options/descriptions.js +2 -0
- package/lib/options/descriptions.js.map +1 -1
- package/lib/options/migrate.d.ts +16 -0
- package/lib/options/migrate.d.ts.map +1 -0
- package/lib/options/migrate.js +115 -0
- package/lib/options/migrate.js.map +1 -0
- package/lib/options/schemas/attributes.d.ts +1 -5
- package/lib/options/schemas/attributes.d.ts.map +1 -1
- package/lib/options/schemas/attributes.js +1 -2
- package/lib/options/schemas/attributes.js.map +1 -1
- package/lib/options/schemas/callees.d.ts +1 -8
- package/lib/options/schemas/callees.d.ts.map +1 -1
- package/lib/options/schemas/callees.js +1 -2
- package/lib/options/schemas/callees.js.map +1 -1
- package/lib/options/schemas/selectors.d.ts +488 -0
- package/lib/options/schemas/selectors.d.ts.map +1 -0
- package/lib/options/schemas/selectors.js +69 -0
- package/lib/options/schemas/selectors.js.map +1 -0
- package/lib/options/schemas/tags.d.ts +1 -1
- package/lib/options/schemas/tags.d.ts.map +1 -1
- package/lib/options/schemas/tags.js +1 -2
- package/lib/options/schemas/tags.js.map +1 -1
- package/lib/options/schemas/variables.d.ts +1 -3
- package/lib/options/schemas/variables.d.ts.map +1 -1
- package/lib/options/schemas/variables.js +1 -2
- package/lib/options/schemas/variables.js.map +1 -1
- package/lib/parsers/angular.d.ts +2 -2
- package/lib/parsers/angular.d.ts.map +1 -1
- package/lib/parsers/angular.js +21 -25
- package/lib/parsers/angular.js.map +1 -1
- package/lib/parsers/es.d.ts +5 -8
- package/lib/parsers/es.d.ts.map +1 -1
- package/lib/parsers/es.js +109 -47
- package/lib/parsers/es.js.map +1 -1
- package/lib/parsers/html.d.ts +2 -2
- package/lib/parsers/html.d.ts.map +1 -1
- package/lib/parsers/html.js +7 -10
- package/lib/parsers/html.js.map +1 -1
- package/lib/parsers/jsx.d.ts +2 -2
- package/lib/parsers/jsx.d.ts.map +1 -1
- package/lib/parsers/jsx.js +8 -13
- package/lib/parsers/jsx.js.map +1 -1
- package/lib/parsers/svelte.d.ts +3 -3
- package/lib/parsers/svelte.d.ts.map +1 -1
- package/lib/parsers/svelte.js +22 -25
- package/lib/parsers/svelte.js.map +1 -1
- package/lib/parsers/vue.d.ts +2 -2
- package/lib/parsers/vue.d.ts.map +1 -1
- package/lib/parsers/vue.js +14 -18
- package/lib/parsers/vue.js.map +1 -1
- package/lib/rules/enforce-canonical-classes.d.ts +146 -16
- package/lib/rules/enforce-canonical-classes.d.ts.map +1 -1
- package/lib/rules/enforce-consistent-class-order.d.ts +146 -16
- package/lib/rules/enforce-consistent-class-order.d.ts.map +1 -1
- package/lib/rules/enforce-consistent-important-position.d.ts +146 -16
- package/lib/rules/enforce-consistent-important-position.d.ts.map +1 -1
- package/lib/rules/enforce-consistent-line-wrapping.d.ts +146 -16
- package/lib/rules/enforce-consistent-line-wrapping.d.ts.map +1 -1
- package/lib/rules/enforce-consistent-variable-syntax.d.ts +148 -18
- package/lib/rules/enforce-consistent-variable-syntax.d.ts.map +1 -1
- package/lib/rules/enforce-shorthand-classes.d.ts +146 -16
- package/lib/rules/enforce-shorthand-classes.d.ts.map +1 -1
- package/lib/rules/no-conflicting-classes.d.ts +146 -16
- package/lib/rules/no-conflicting-classes.d.ts.map +1 -1
- package/lib/rules/no-deprecated-classes.d.ts +146 -16
- package/lib/rules/no-deprecated-classes.d.ts.map +1 -1
- package/lib/rules/no-duplicate-classes.d.ts +146 -16
- package/lib/rules/no-duplicate-classes.d.ts.map +1 -1
- package/lib/rules/no-restricted-classes.d.ts +146 -16
- package/lib/rules/no-restricted-classes.d.ts.map +1 -1
- package/lib/rules/no-unknown-classes.d.ts +146 -16
- package/lib/rules/no-unknown-classes.d.ts.map +1 -1
- package/lib/rules/no-unnecessary-whitespace.d.ts +146 -16
- package/lib/rules/no-unnecessary-whitespace.d.ts.map +1 -1
- package/lib/types/rule.d.ts +39 -0
- package/lib/types/rule.d.ts.map +1 -1
- package/lib/types/rule.js +7 -0
- package/lib/types/rule.js.map +1 -1
- package/lib/utils/rule.d.ts.map +1 -1
- package/lib/utils/rule.js +42 -2
- package/lib/utils/rule.js.map +1 -1
- package/lib/utils/selectors.d.ts +3 -0
- package/lib/utils/selectors.d.ts.map +1 -0
- package/lib/utils/selectors.js +4 -0
- package/lib/utils/selectors.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -168,7 +168,7 @@ This plugin is pre-configured to lint tailwind classes for the most popular util
|
|
|
168
168
|
|
|
169
169
|
### Advanced configuration
|
|
170
170
|
|
|
171
|
-
If an utility is not supported by default, or you want to customize the configuration, you can define which [
|
|
171
|
+
If an utility is not supported by default, or you want to customize the configuration, you can define which [attributes](./docs/configuration/advanced.md#attribute), [callees](./docs/configuration/advanced.md#callee), [variables](./docs/configuration/advanced.md#variable), and [tags](./docs/configuration/advanced.md#tag) should get linted.
|
|
172
172
|
See the [Advanced configuration guide](./docs/configuration/advanced.md) to learn how to override or extend the default settings.
|
|
173
173
|
|
|
174
174
|
<br/>
|
package/lib/api/defaults.d.ts
CHANGED
|
@@ -1,18 +1,88 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
match: import("
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { SelectorKind } from "../types/rule.js";
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated Migrate to selectors instead.
|
|
4
|
+
*/
|
|
5
|
+
export declare function getDefaultCallees(): (string | [string, ({
|
|
6
|
+
match: import("../types/rule.js").MatcherType.String;
|
|
7
|
+
} | {
|
|
8
|
+
match: import("../types/rule.js").MatcherType.ObjectKey;
|
|
9
|
+
pathPattern?: string | undefined;
|
|
10
|
+
} | {
|
|
11
|
+
match: import("../types/rule.js").MatcherType.ObjectValue;
|
|
12
|
+
pathPattern?: string | undefined;
|
|
13
|
+
})[]])[];
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated Migrate to selectors instead.
|
|
16
|
+
*/
|
|
9
17
|
export declare function getDefaultAttributes(): (string | [string, ({
|
|
10
|
-
match: import("
|
|
18
|
+
match: import("../types/rule.js").MatcherType.String;
|
|
19
|
+
} | {
|
|
20
|
+
match: import("../types/rule.js").MatcherType.ObjectKey;
|
|
21
|
+
pathPattern?: string | undefined;
|
|
11
22
|
} | {
|
|
12
|
-
match: import("
|
|
23
|
+
match: import("../types/rule.js").MatcherType.ObjectValue;
|
|
24
|
+
pathPattern?: string | undefined;
|
|
13
25
|
})[]])[];
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export declare function
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated Migrate to selectors instead.
|
|
28
|
+
*/
|
|
29
|
+
export declare function getDefaultVariables(): (string | [string, ({
|
|
30
|
+
match: import("../types/rule.js").MatcherType.String;
|
|
31
|
+
} | {
|
|
32
|
+
match: import("../types/rule.js").MatcherType.ObjectKey;
|
|
33
|
+
pathPattern?: string | undefined;
|
|
34
|
+
} | {
|
|
35
|
+
match: import("../types/rule.js").MatcherType.ObjectValue;
|
|
36
|
+
pathPattern?: string | undefined;
|
|
37
|
+
})[]])[];
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated Migrate to selectors instead.
|
|
40
|
+
*/
|
|
41
|
+
export declare function getDefaultTags(): (string | [string, ({
|
|
42
|
+
match: import("../types/rule.js").MatcherType.String;
|
|
43
|
+
} | {
|
|
44
|
+
match: import("../types/rule.js").MatcherType.ObjectKey;
|
|
45
|
+
pathPattern?: string | undefined;
|
|
46
|
+
} | {
|
|
47
|
+
match: import("../types/rule.js").MatcherType.ObjectValue;
|
|
48
|
+
pathPattern?: string | undefined;
|
|
49
|
+
})[]])[];
|
|
50
|
+
export declare function getDefaultSelectors(): ({
|
|
51
|
+
kind: SelectorKind.Callee;
|
|
52
|
+
match: {
|
|
53
|
+
type: import("../types/rule.js").MatcherType.String;
|
|
54
|
+
}[];
|
|
55
|
+
name: string;
|
|
56
|
+
} | {
|
|
57
|
+
kind: SelectorKind.Callee;
|
|
58
|
+
match: {
|
|
59
|
+
type: import("../types/rule.js").MatcherType.ObjectKey;
|
|
60
|
+
}[];
|
|
61
|
+
name: string;
|
|
62
|
+
} | {
|
|
63
|
+
kind: SelectorKind.Callee;
|
|
64
|
+
match: {
|
|
65
|
+
path: string;
|
|
66
|
+
type: import("../types/rule.js").MatcherType.ObjectValue;
|
|
67
|
+
}[];
|
|
68
|
+
name: string;
|
|
69
|
+
} | {
|
|
70
|
+
kind: SelectorKind.Attribute;
|
|
71
|
+
name: string;
|
|
72
|
+
match?: never;
|
|
73
|
+
} | {
|
|
74
|
+
kind: SelectorKind.Attribute;
|
|
75
|
+
match: ({
|
|
76
|
+
type: import("../types/rule.js").MatcherType.String;
|
|
77
|
+
} | {
|
|
78
|
+
type: import("../types/rule.js").MatcherType.ObjectKey;
|
|
79
|
+
})[];
|
|
80
|
+
name: string;
|
|
81
|
+
} | {
|
|
82
|
+
kind: SelectorKind.Variable;
|
|
83
|
+
match: {
|
|
84
|
+
type: import("../types/rule.js").MatcherType.String;
|
|
85
|
+
}[];
|
|
86
|
+
name: string;
|
|
87
|
+
})[];
|
|
18
88
|
//# sourceMappingURL=defaults.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/api/defaults.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/api/defaults.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAQhE;;GAEG;AACH,wBAAgB,iBAAiB;;;;;;;;SAIhC;AAED;;GAEG;AACH,wBAAgB,oBAAoB;;;;;;;;SAInC;AAED;;GAEG;AACH,wBAAgB,mBAAmB;;;;;;;;SAIlC;AAED;;GAEG;AACH,wBAAgB,cAAc;;;;;;;;SAI7B;AAED,wBAAgB,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAElC"}
|
package/lib/api/defaults.js
CHANGED
|
@@ -1,14 +1,34 @@
|
|
|
1
|
-
|
|
1
|
+
/* eslint-disable eslint-plugin-jsdoc/require-returns */
|
|
2
|
+
/* eslint-disable eslint-plugin-jsdoc/require-description */
|
|
3
|
+
import { DEFAULT_SELECTORS } from "../options/default-options.js";
|
|
4
|
+
import { migrateFlatSelectorsToLegacySelectors } from "../options/migrate.js";
|
|
5
|
+
import { SelectorKind } from "../types/rule.js";
|
|
6
|
+
import { isSelectorKind } from "../utils/selectors.js";
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated Migrate to selectors instead.
|
|
9
|
+
*/
|
|
2
10
|
export function getDefaultCallees() {
|
|
3
|
-
return
|
|
11
|
+
return migrateFlatSelectorsToLegacySelectors(DEFAULT_SELECTORS.filter(isSelectorKind(SelectorKind.Callee))).callees ?? [];
|
|
4
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated Migrate to selectors instead.
|
|
15
|
+
*/
|
|
5
16
|
export function getDefaultAttributes() {
|
|
6
|
-
return
|
|
17
|
+
return migrateFlatSelectorsToLegacySelectors(DEFAULT_SELECTORS.filter(isSelectorKind(SelectorKind.Attribute))).attributes ?? [];
|
|
7
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated Migrate to selectors instead.
|
|
21
|
+
*/
|
|
8
22
|
export function getDefaultVariables() {
|
|
9
|
-
return
|
|
23
|
+
return migrateFlatSelectorsToLegacySelectors(DEFAULT_SELECTORS.filter(isSelectorKind(SelectorKind.Variable))).variables ?? [];
|
|
10
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated Migrate to selectors instead.
|
|
27
|
+
*/
|
|
11
28
|
export function getDefaultTags() {
|
|
12
|
-
return
|
|
29
|
+
return migrateFlatSelectorsToLegacySelectors(DEFAULT_SELECTORS.filter(isSelectorKind(SelectorKind.Tag))).tags ?? [];
|
|
30
|
+
}
|
|
31
|
+
export function getDefaultSelectors() {
|
|
32
|
+
return DEFAULT_SELECTORS;
|
|
13
33
|
}
|
|
14
34
|
//# sourceMappingURL=defaults.js.map
|
package/lib/api/defaults.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.js","sourceRoot":"","sources":["../../src/api/defaults.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"defaults.js","sourceRoot":"","sources":["../../src/api/defaults.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,4DAA4D;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,EAAE,qCAAqC,EAAE,MAAM,uCAAuC,CAAC;AAC9F,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAOvE;;GAEG;AACH,MAAM,UAAU,iBAAiB;IAC/B,OAAO,qCAAqC,CAC1C,iBAAiB,CAAC,MAAM,CAAC,cAAc,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAC9D,CAAC,OAAO,IAAI,EAAoB,CAAC;AACpC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB;IAClC,OAAO,qCAAqC,CAC1C,iBAAiB,CAAC,MAAM,CAAC,cAAc,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CACjE,CAAC,UAAU,IAAI,EAAuB,CAAC;AAC1C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB;IACjC,OAAO,qCAAqC,CAC1C,iBAAiB,CAAC,MAAM,CAAC,cAAc,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAChE,CAAC,SAAS,IAAI,EAAsB,CAAC;AACxC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,qCAAqC,CAC1C,iBAAiB,CAAC,MAAM,CAAC,cAAc,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAC3D,CAAC,IAAI,IAAI,EAAiB,CAAC;AAC9B,CAAC;AAED,MAAM,UAAU,mBAAmB;IACjC,OAAO,iBAAiB,CAAC;AAC3B,CAAC"}
|
package/lib/api/types.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type { ObjectKeyMatcher, ObjectValueMatcher, Regex, StringMatcher } from "../types/rule.js";
|
|
2
|
-
export { MatcherType } from "../types/rule.js";
|
|
1
|
+
export type { CallTarget, ObjectKeyMatcher, ObjectValueMatcher, Regex, Selector, SelectorMatcher, Selectors, StringMatcher } from "../types/rule.js";
|
|
2
|
+
export { MatcherType, SelectorKind } from "../types/rule.js";
|
|
3
3
|
//# sourceMappingURL=types.d.ts.map
|
package/lib/api/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/api/types.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,gBAAgB,EAChB,kBAAkB,EAClB,KAAK,EACL,aAAa,EACd,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/api/types.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EAClB,KAAK,EACL,QAAQ,EACR,eAAe,EACf,SAAS,EACT,aAAa,EACd,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC"}
|
package/lib/api/types.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { MatcherType } from "../types/rule.js";
|
|
1
|
+
export { MatcherType, SelectorKind } from "../types/rule.js";
|
|
2
2
|
//# sourceMappingURL=types.js.map
|
package/lib/api/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/api/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/api/types.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC"}
|