|
1 | | -import { $, lintMonorepoPackageJSONs, lintScript } from "complete-node"; |
| 1 | +import { lintCommands, lintMonorepoPackageJSONs } from "complete-node"; |
| 2 | +import path from "node:path"; |
2 | 3 |
|
3 | | -await lintScript(import.meta.dirname, async (packageRoot) => { |
4 | | - await Promise.all([ |
5 | | - // Use TypeScript to type-check the code. |
6 | | - $`tsc --noEmit`, |
| 4 | +const MONOREPO_ROOT = path.resolve(import.meta.dirname, ".."); |
7 | 5 |
|
8 | | - // Use ESLint to lint the TypeScript code. |
9 | | - // - "--max-warnings 0" makes warnings fail, since we set all ESLint errors to warnings. |
10 | | - $`eslint --max-warnings 0 scripts *.mjs`, // We have to exclude the packages directory. |
| 6 | +await lintCommands(import.meta.dirname, [ |
| 7 | + // Use TypeScript to type-check the code. |
| 8 | + "tsc --noEmit", |
11 | 9 |
|
12 | | - // Use Prettier to check formatting. |
13 | | - // - "--log-level=warn" makes it only output errors. |
14 | | - $`prettier --log-level=warn --check .`, |
| 10 | + // Use ESLint to lint the TypeScript code. |
| 11 | + // - "--max-warnings 0" makes warnings fail, since we set all ESLint errors to warnings. |
| 12 | + "eslint --max-warnings 0 scripts *.mjs", // We have to exclude the packages directory. |
15 | 13 |
|
16 | | - // Use Knip to check for unused files, exports, and dependencies. |
17 | | - $`knip --no-progress`, |
| 14 | + // Use Prettier to check formatting. |
| 15 | + // - "--log-level=warn" makes it only output errors. |
| 16 | + "prettier --log-level=warn --check .", |
18 | 17 |
|
19 | | - // Use CSpell to spell check every file. |
20 | | - // - "--no-progress" and "--no-summary" make it only output errors. |
21 | | - $`cspell --no-progress --no-summary .`, |
| 18 | + // Use Knip to check for unused files, exports, and dependencies. |
| 19 | + "knip --no-progress", |
22 | 20 |
|
23 | | - // Check for unused words in the CSpell configuration file. |
24 | | - $`cspell-check-unused-words`, |
| 21 | + // Use CSpell to spell check every file. |
| 22 | + // - "--no-progress" and "--no-summary" make it only output errors. |
| 23 | + "cspell --no-progress --no-summary .", |
25 | 24 |
|
26 | | - // Check for template updates. |
27 | | - $`tsx ./packages/isaacscript-cli/src/main.ts check --ignore bundleEntry.ts,ci.yml,eslint.config.mjs,lint.ts,tsconfig.json`, |
| 25 | + // Check for unused words in the CSpell configuration file. |
| 26 | + "cspell-check-unused-words", |
28 | 27 |
|
29 | | - // Check to see if the child "package.json" files are up to date. |
30 | | - lintMonorepoPackageJSONs(packageRoot), |
31 | | - ]); |
32 | | -}); |
| 28 | + // Check for template updates. |
| 29 | + "tsx ./packages/isaacscript-cli/src/main.ts check --ignore bundleEntry.ts,ci.yml,eslint.config.mjs,lint.ts,tsconfig.json", |
| 30 | + |
| 31 | + // Check to see if the child "package.json" files are up to date. |
| 32 | + ["lintMonorepoPackageJSONs", lintMonorepoPackageJSONs(MONOREPO_ROOT)], |
| 33 | +]); |
0 commit comments