Merge pull request #12402 from Kilo-Org/fix/vscode-unfiltered-typecheck

fix(vscode): enforce unfiltered webview typechecks
This commit is contained in:
Christiaan Arnoldus
2026-07-21 13:21:21 +02:00
committed by GitHub
5 changed files with 15 additions and 41 deletions
+4 -2
View File
@@ -740,6 +740,8 @@ export function Diff<T>(props: DiffProps<T>) {
containerWrapper: container,
})
} else {
const oldFile = local.before!
const newFile = local.after!
const beforeContents = before()
const afterContents = after()
@@ -749,8 +751,8 @@ export function Diff<T>(props: DiffProps<T>) {
}
instance.render({
oldFile: { ...local.before, contents: beforeContents, cacheKey: cacheKey(beforeContents) },
newFile: { ...local.after, contents: afterContents, cacheKey: cacheKey(afterContents) },
oldFile: { ...oldFile, contents: beforeContents, cacheKey: cacheKey(beforeContents) },
newFile: { ...newFile, contents: afterContents, cacheKey: cacheKey(afterContents) },
lineAnnotations: annotations,
containerWrapper: container,
})
+1
View File
@@ -8,6 +8,7 @@
"webview-ui/kiloclaw/index.tsx",
"webview-ui/marketplace/index.tsx",
"webview-ui/pierre-worker.ts",
"webview-ui/src/assets.d.ts",
"webview-ui/src/index.tsx",
"src/**/__tests__/**/*.{ts,spec.ts}",
"src/**/*.test.ts",
+1 -1
View File
@@ -1172,7 +1172,7 @@
"watch-tests": "tsc -p . -w --outDir out",
"pretest": "bun run compile-tests && bun run compile && bun run lint",
"check-types": "tsc --noEmit",
"check-types:webview": "bun script/typecheck.ts --project webview-ui/tsconfig.json",
"check-types:webview": "tsc --noEmit --project webview-ui/tsconfig.json",
"typecheck": "bun run check-types && bun run check-types:webview",
"format": "prettier --write .",
"format:check": "prettier --check .",
-38
View File
@@ -1,38 +0,0 @@
#!/usr/bin/env bun
/**
* Cross-platform typecheck script that runs tsc and filters errors.
*
* Replaces the previous bash/grep pipeline so `bun run typecheck` works
* on Windows without POSIX tools.
*
* Usage:
* bun script/typecheck.ts # check extension
* bun script/typecheck.ts --project webview-ui/tsconfig.json # check webview
*
* Filtering rules:
* - Only lines matching "error TS" are reported
* - Lines starting with ".." (parent node_modules) are excluded
* - For the webview project, "@pierre/diffs" errors are also excluded
*/
import { $ } from "bun"
const args = process.argv.slice(2)
const projectIdx = args.indexOf("--project")
const project = projectIdx !== -1 ? args[projectIdx + 1] : undefined
const webview = project?.includes("webview-ui")
const tscArgs = project ? ["--noEmit", "--project", project] : ["--noEmit"]
const result = await $`tsc ${tscArgs}`.nothrow().quiet()
const output = result.stdout.toString() + result.stderr.toString()
const errors = output
.split("\n")
.filter((line) => line.includes("error TS"))
.filter((line) => !line.startsWith(".."))
.filter((line) => !webview || !line.includes("@pierre/diffs"))
if (errors.length > 0) {
console.error(errors.join("\n"))
process.exit(1)
}
+9
View File
@@ -0,0 +1,9 @@
declare module "*.svg" {
const src: string
export default src
}
declare module "*?worker&url" {
const src: string
export default src
}