Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(lint): handle undefined scale references in lint script

Steven Enamakel39d48d4c0358
diff --git a/app/scripts/lint-undefined-scales.mjs b/app/scripts/lint-undefined-scales.mjs
index 34cb64562f..13fabc5c4f 100644
--- a/app/scripts/lint-undefined-scales.mjs
+++ b/app/scripts/lint-undefined-scales.mjs
@@ -77,7 +77,8 @@ function shadeResolver() {
// NAME does not — `bg-accent-500`, `bg-surface-500` and `text-content-500`
// all passed the previous version of this lint while emitting no CSS.
const resolveConfig = resolveConfigModule.default ?? resolveConfigModule;
- const colors = resolveConfig(loadTailwindConfig())?.theme?.colors;
+ const resolved = resolveConfig(loadTailwindConfig());
+ const colors = resolved?.theme?.colors;
if (!colors || Object.keys(colors).length === 0) {
throw new Error(
'lint:ui-tokens: resolved theme.colors is empty — refusing to run, since ' +
@@ -120,7 +121,7 @@ function shadeResolver() {
return false;
};
- return { shadeExists, bareExists };
+ return { shadeExists, bareExists, resolved };
}
@@ -173,7 +174,8 @@ function* walk(dir) {
}
}
-const { shadeExists, bareExists } = shadeResolver();
+const { shadeExists, bareExists, resolved } = shadeResolver();
+const nonColour = nonColourValues(resolved);
const violations = [];
for (const file of walk(path.join(appRoot, 'src'))) {