pasika 0.10.128 → 0.10.129
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 +12 -10
- package/package.json +1 -1
|
@@ -10675,15 +10675,17 @@ var rootVariablesRule = {
|
|
|
10675
10675
|
const names = new Set(
|
|
10676
10676
|
graph.definitions.filter((symbol) => symbol.kind === "theme-token").map((symbol) => symbol.name)
|
|
10677
10677
|
);
|
|
10678
|
-
function
|
|
10679
|
-
const
|
|
10680
|
-
|
|
10681
|
-
|
|
10682
|
-
|
|
10683
|
-
|
|
10684
|
-
|
|
10685
|
-
|
|
10686
|
-
|
|
10678
|
+
function isFixedThemeExpression(name, value, visited = /* @__PURE__ */ new Set([name])) {
|
|
10679
|
+
const references = [...value.matchAll(/\bvar\s*\(\s*(?<target>--[a-z][\w-]*)/giu)].map(
|
|
10680
|
+
(match) => match.groups?.target
|
|
10681
|
+
);
|
|
10682
|
+
if (references.length === 0) return true;
|
|
10683
|
+
return references.every((target) => {
|
|
10684
|
+
if (!target || visited.has(target)) return false;
|
|
10685
|
+
const next = themeValues.get(target);
|
|
10686
|
+
if (!next) return false;
|
|
10687
|
+
return isFixedThemeExpression(target, next, /* @__PURE__ */ new Set([...visited, target]));
|
|
10688
|
+
});
|
|
10687
10689
|
}
|
|
10688
10690
|
const mirroredTokens = /* @__PURE__ */ new Set();
|
|
10689
10691
|
let hasPlainThemeBlocks = false;
|
|
@@ -10798,7 +10800,7 @@ var rootVariablesRule = {
|
|
|
10798
10800
|
context.report({ node: theme, message: REDUNDANT_INLINE_MESSAGE(name) });
|
|
10799
10801
|
}
|
|
10800
10802
|
}
|
|
10801
|
-
if (inline === referencesVariable || !inline &&
|
|
10803
|
+
if (inline === referencesVariable || !inline && isFixedThemeExpression(name, unquoted)) continue;
|
|
10802
10804
|
const offset = (theme.loc?.start.offset ?? 0) + match.index + match[0].indexOf(name);
|
|
10803
10805
|
const preceding = context.sourceCode.text.slice(0, offset);
|
|
10804
10806
|
const line = preceding.split("\n").length;
|