The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 22, 07:00 UTC
fix(scripts): check:changed lints Astro components and runs knip for them (#29573)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Alex Southwell committed
Nov 3, 2026 at 01:42 UTC
8cebee4277a70152dbe0e8c499d9a04c88acd7b9
2 files changed
+13
-1
scripts/check-changed.test.ts
+11
@@ -407,6 +407,17 @@ it("checks changed source paths through the Windows launcher", () => {
407
expect(result.stdout).toContain("fixture stderr: lint");
408
});
409
410
+it("lints an Astro component and runs knip when only it changed", () => {
411
+ using project = launcherFixture();
412
+ const page = "packages/example/Page.astro";
413
+ project.write(page, "---\nconst title = 1;\n---\n<h1>{title}</h1>\n");
414
+ const result = project.run();
415
+ expect(result.status, result.stdout + result.stderr).toBe(0);
416
+ const calls = project.calls();
417
+ expect(calls.find(({ args }) => args[0] === "lint")?.args).toEqual(["lint", page]);
418
+ expect(calls.some(({ args }) => args[0] === "exec" && args[1] === "knip")).toBe(true);
419
+});
420
+
421
it.each(["install", "lint"])("reports a failing %s step with its output", (step) => {
422
using project = launcherFixture();
423
project.write(project.source, "export const value = 2;\n");
scripts/check-changed.ts
+2
-1
@@ -172,7 +172,8 @@ export const comparisonBase = Effect.fn("checkChanged.comparisonBase")(function*
172
return closest;
173
});
174
175
-const CODE = /\.[cm]?[jt]sx?$/;
175
+// CI's lint and knip also read Astro components' frontmatter.
176
+const CODE = /\.(?:[cm]?[jt]sx?|astro)$/;
177
const TEST = /\.test\.[cm]?[jt]sx?$/;
178
// CI runs the .github/scripts tests with `node --test`; vitest passes a failing node:test file.
179
const NODE_TEST = /^\.github[/\\]scripts[/\\]/;