mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 10:25:42 +01:00
Fix playground type errors and add CI test
This commit is contained in:
parent
f20e0c8d47
commit
01b6fa5b2e
11 changed files with 150 additions and 49 deletions
32
website/scripts/check-playground-samples-js.ts
Normal file
32
website/scripts/check-playground-samples-js.ts
Normal 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);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue