mirror of
https://github.com/bitwarden/browser
synced 2025-12-11 13:53:34 +00:00
Return error code when any tsc typecheck fails (#5459)
* Return error code when any tsc typecheck fails * Try with bash `sh ./scripts/test-types.s` resulted in errors missing `[[`, which is a bash builtin. It's possible the ubuntu runner is using some other shell. * Fix spec type errors * Switch to node for Windows compatibility
This commit is contained in:
29
scripts/test-types.js
Normal file
29
scripts/test-types.js
Normal file
@@ -0,0 +1,29 @@
|
||||
const concurrently = require("concurrently");
|
||||
const path = require("path");
|
||||
const fs = require("fs");
|
||||
|
||||
function getFiles(dir) {
|
||||
results = [];
|
||||
fs.readdirSync(dir).forEach((file) => {
|
||||
file = path.join(dir, file);
|
||||
const stat = fs.statSync(file);
|
||||
if (stat && stat.isDirectory()) {
|
||||
results = results.concat(getFiles(file));
|
||||
} else {
|
||||
results.push(file);
|
||||
}
|
||||
});
|
||||
return results;
|
||||
}
|
||||
|
||||
const files = getFiles(path.join(__dirname, "..", "libs")).filter((file) => {
|
||||
const name = path.basename(file);
|
||||
return name === "tsconfig.spec.json";
|
||||
});
|
||||
|
||||
concurrently(
|
||||
files.map((file) => ({
|
||||
name: path.basename(path.dirname(file)),
|
||||
command: `npx tsc --noEmit --project ${file}`,
|
||||
}))
|
||||
);
|
||||
Reference in New Issue
Block a user