init
This commit is contained in:
247 files changed
+35538
No files matched your search
@@ -0,0 +1,11 @@
|
||||
import { readdir } from 'node:fs/promises';
|
||||
import { spawnSync } from 'node:child_process';
|
||||
async function files(path) {
|
||||
const entries = await readdir(path, { withFileTypes: true });
|
||||
return (await Promise.all(entries.map(entry => entry.isDirectory() ? files(`${path}/${entry.name}`) : `${path}/${entry.name}`))).flat();
|
||||
}
|
||||
for (const file of (await Promise.all(['api', 'src', 'scripts', 'tests', 'public'].map(files))).flat().filter(file => file.endsWith('.mjs'))) {
|
||||
const result = spawnSync(process.execPath, ['--check', file], { stdio: 'inherit' });
|
||||
if (result.status !== 0) process.exit(1);
|
||||
}
|
||||
console.log('JavaScript syntax checks passed');
|
||||
Reference in new issue
Block a user