Fix playground type errors and add CI test

This commit is contained in:
tamayika 2023-03-04 21:38:19 +09:00
parent f20e0c8d47
commit 01b6fa5b2e
11 changed files with 150 additions and 49 deletions

View file

@ -0,0 +1,32 @@
import { spawnSync } from "child_process";
import { globSync } from "glob";
import { exit } from "process";
let someFileError = false;
const files = globSync("src/website/data/playground-samples/*/*/*.js");
for (const file of files) {
const command = `yarn tsc --noEmit --allowJs --checkJs --skipLibCheck ../out/monaco-editor/monaco.d.ts ${file}`;
console.log(file);
const { status, stdout } = spawnSync(
"yarn",
[
"tsc",
"--noEmit",
"--allowJs",
"--checkJs",
"--skipLibCheck",
"../out/monaco-editor/monaco.d.ts",
file,
],
{ shell: true }
);
if (status != 0) {
console.log(stdout.toString());
someFileError = true;
}
}
if (someFileError) {
console.error("Some files had type errors.");
exit(1);
}