pasika 0.10.105 → 0.10.106
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/eslint/pasika/index.js +34 -1
- package/package.json +1 -1
|
@@ -9800,6 +9800,12 @@ var cssEntryPointRule = {
|
|
|
9800
9800
|
}
|
|
9801
9801
|
};
|
|
9802
9802
|
|
|
9803
|
+
// eslint/project/semantic-color-role.ts
|
|
9804
|
+
var BOUNDARY_PROPERTY_WORDS = /* @__PURE__ */ new Set(["border", "outline", "ring", "stroke"]);
|
|
9805
|
+
function violatesBoundaryColorRole(token) {
|
|
9806
|
+
return !token.endsWith("-edge") && token.split("-").some((word) => BOUNDARY_PROPERTY_WORDS.has(word));
|
|
9807
|
+
}
|
|
9808
|
+
|
|
9803
9809
|
// eslint/rules/tailwind/css-variable-naming.ts
|
|
9804
9810
|
var EDGE_PROPERTY_WORDS = /* @__PURE__ */ new Set(["border", "outline", "ring", "stroke"]);
|
|
9805
9811
|
var NON_COLOR_WORDS = /* @__PURE__ */ new Set(["height", "leading", "offset", "radius", "size", "spacing", "style", "width"]);
|
|
@@ -9847,7 +9853,15 @@ var cssVariableNamingRule = {
|
|
|
9847
9853
|
Declaration(node) {
|
|
9848
9854
|
const property = node.property;
|
|
9849
9855
|
if (!property.startsWith("--")) return;
|
|
9850
|
-
if (isTailwindThemeVariable(property))
|
|
9856
|
+
if (isTailwindThemeVariable(property)) {
|
|
9857
|
+
if (property.startsWith("--color-") && violatesBoundaryColorRole(property.slice("--color-".length))) {
|
|
9858
|
+
context.report({
|
|
9859
|
+
node,
|
|
9860
|
+
message: `Theme color "${property}" names a boundary using a CSS property; use --color-<role>-edge and border-<role>-edge instead.`
|
|
9861
|
+
});
|
|
9862
|
+
}
|
|
9863
|
+
return;
|
|
9864
|
+
}
|
|
9851
9865
|
const lower = property.toLowerCase();
|
|
9852
9866
|
if ((lower.includes("bg") || lower.includes("background")) && !lower.endsWith("-canvas")) {
|
|
9853
9867
|
context.report({
|
|
@@ -10807,6 +10821,18 @@ function isColorToken(token, inventory) {
|
|
|
10807
10821
|
if (hyphen === -1) return false;
|
|
10808
10822
|
return DEFAULT_PALETTE_FAMILIES.has(token.slice(0, hyphen)) && DEFAULT_PALETTE_SHADES.has(token.slice(hyphen + 1));
|
|
10809
10823
|
}
|
|
10824
|
+
function isInvalidBoundaryColorClass(className, inventory) {
|
|
10825
|
+
if (className.includes("[") || className.includes("(")) return false;
|
|
10826
|
+
const utility = (className.replace(/!+$/, "").split(":").pop() ?? "").split("/")[0] ?? "";
|
|
10827
|
+
const compound = Object.keys(PREFIX_NAMESPACES).find(
|
|
10828
|
+
(prefix2) => prefix2.includes("-") && utility.startsWith(`${prefix2}-`)
|
|
10829
|
+
);
|
|
10830
|
+
const dash = utility.indexOf("-");
|
|
10831
|
+
if (dash === -1) return false;
|
|
10832
|
+
const prefix = compound ?? utility.slice(0, dash);
|
|
10833
|
+
const token = utility.slice(prefix.length + 1);
|
|
10834
|
+
return (PREFIX_NAMESPACES[prefix]?.includes("color") ?? false) && (inventory.themeTokens.get("color")?.has(token) ?? false) && violatesBoundaryColorRole(token);
|
|
10835
|
+
}
|
|
10810
10836
|
function isKnown(className, inventory) {
|
|
10811
10837
|
if (className.includes("[") || className.includes("(")) return true;
|
|
10812
10838
|
const segments = className.replace(/!+$/, "").split(":");
|
|
@@ -10867,6 +10893,13 @@ var unknownUtilityRule = {
|
|
|
10867
10893
|
for (const candidate of value.split(/\s+/)) {
|
|
10868
10894
|
if (!candidate || seen.has(candidate)) continue;
|
|
10869
10895
|
seen.add(candidate);
|
|
10896
|
+
if (isInvalidBoundaryColorClass(candidate, inventory)) {
|
|
10897
|
+
context.report({
|
|
10898
|
+
node,
|
|
10899
|
+
message: `Utility class "${candidate}" uses a boundary color token named after a CSS property; use a semantic -edge color token instead (for example, border-control-edge).`
|
|
10900
|
+
});
|
|
10901
|
+
continue;
|
|
10902
|
+
}
|
|
10870
10903
|
if (isKnown(candidate, inventory)) continue;
|
|
10871
10904
|
const plainBase = candidate.replace(/!+$/, "").split(":").pop() ?? "";
|
|
10872
10905
|
if (inventory.plainClasses.has(plainBase)) {
|