pr-checkmate 1.22.0 → 1.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -2
- package/dist/core/checks/typecheck.js +9 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
# ♟️ PR CheckMate
|
|
2
2
|
|
|
3
3
|

|
|
4
|
-

|
|
5
4
|

|
|
6
|
-
|
|
7
5
|

|
|
8
6
|

|
|
9
7
|

|
|
@@ -32,6 +32,15 @@ exports.typecheckCheck = {
|
|
|
32
32
|
return node_fs_1.default.existsSync(node_path_1.default.join(ctx.cwd, 'tsconfig.json'));
|
|
33
33
|
},
|
|
34
34
|
async run(ctx) {
|
|
35
|
+
// tsc needs the project's installed type declarations — everything listed in
|
|
36
|
+
// tsconfig's `types`, plus every imported @types package — to resolve. When the
|
|
37
|
+
// project's dependencies aren't installed (e.g. a CI step that runs pr-checkmate
|
|
38
|
+
// via npx without a prior `npm ci`), tsc emits a wall of cryptic TS2688
|
|
39
|
+
// "cannot find type definition file" errors that look like code problems but are
|
|
40
|
+
// really a setup gap. Skip with an actionable message instead of failing the PR.
|
|
41
|
+
if (!node_fs_1.default.existsSync(node_path_1.default.join(ctx.cwd, 'node_modules'))) {
|
|
42
|
+
return (0, types_1.skip)('project dependencies not installed (no node_modules) — run `npm ci` before typecheck');
|
|
43
|
+
}
|
|
35
44
|
const tscBin = resolveTsc(ctx.cwd);
|
|
36
45
|
const result = await (0, execa_1.execa)(process.execPath, [tscBin, '--noEmit'], {
|
|
37
46
|
cwd: ctx.cwd,
|