pr-checkmate 3.2.3 → 3.3.0
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/.eslintrc.js +3 -9
- package/README.md +1 -1
- package/dist/cjs/cli.js +13 -0
- package/dist/cjs/config/pr-checkmate.template.json +1 -1
- package/dist/cjs/core/checks/dependencies/grype-scan.js +18 -0
- package/dist/cjs/core/checks/languages/lint.js +12 -0
- package/dist/cjs/core/checks/languages/ruff-shared.js +6 -1
- package/dist/cjs/core/checks/pr/commitlint.js +4 -2
- package/dist/cjs/core/checks/quality/package-size.d.ts +23 -1
- package/dist/cjs/core/checks/quality/package-size.js +20 -4
- package/dist/cjs/core/checks/quality/spellcheck.js +8 -5
- package/dist/cjs/core/install/doctor.js +12 -0
- package/dist/cjs/core/install/grype-db.d.ts +25 -0
- package/dist/cjs/core/install/grype-db.js +45 -0
- package/dist/cjs/core/install/profiles.d.ts +1 -1
- package/dist/cjs/core/install/profiles.js +1 -1
- package/dist/cjs/core/install/reuse.js +6 -3
- package/dist/cjs/init.d.ts +0 -8
- package/dist/cjs/init.js +1 -2
- package/dist/cjs/utils/own-deps.js +8 -1
- package/dist/cjs/utils/resolve-bin.d.ts +2 -0
- package/dist/cjs/utils/resolve-bin.js +5 -0
- package/dist/esm/cli.js +14 -1
- package/dist/esm/config/pr-checkmate.template.json +1 -1
- package/dist/esm/core/checks/dependencies/dependency-check.js +2 -2
- package/dist/esm/core/checks/dependencies/grype-scan.js +18 -0
- package/dist/esm/core/checks/dependencies/license-check.js +2 -2
- package/dist/esm/core/checks/dependencies/npm-audit.js +2 -2
- package/dist/esm/core/checks/git/diff-smell.js +1 -1
- package/dist/esm/core/checks/languages/cpp-format.js +1 -1
- package/dist/esm/core/checks/languages/lint.js +12 -3
- package/dist/esm/core/checks/languages/prettier.js +3 -3
- package/dist/esm/core/checks/languages/python-format.js +2 -2
- package/dist/esm/core/checks/languages/python-lint.js +2 -2
- package/dist/esm/core/checks/languages/ruff-shared.js +6 -1
- package/dist/esm/core/checks/languages/typecheck.js +1 -1
- package/dist/esm/core/checks/pr/commitlint.js +4 -2
- package/dist/esm/core/checks/pr/pr-body.js +1 -1
- package/dist/esm/core/checks/pr/pr-size-check.js +1 -1
- package/dist/esm/core/checks/pr/pr-title-lint.js +1 -1
- package/dist/esm/core/checks/quality/dead-code.js +1 -1
- package/dist/esm/core/checks/quality/duplicate-check.js +1 -1
- package/dist/esm/core/checks/quality/markdown-lint.js +1 -1
- package/dist/esm/core/checks/quality/package-size.d.ts +23 -1
- package/dist/esm/core/checks/quality/package-size.js +19 -4
- package/dist/esm/core/checks/quality/spellcheck.js +11 -8
- package/dist/esm/core/checks/security/diff-security.js +1 -1
- package/dist/esm/core/checks/security/security.js +1 -1
- package/dist/esm/core/install/doctor.js +12 -0
- package/dist/esm/core/install/grype-db.d.ts +25 -0
- package/dist/esm/core/install/grype-db.js +41 -0
- package/dist/esm/core/install/prepare.js +1 -1
- package/dist/esm/core/install/profiles.d.ts +1 -1
- package/dist/esm/core/install/profiles.js +1 -1
- package/dist/esm/core/install/reuse.js +6 -3
- package/dist/esm/core/run-checks.js +2 -2
- package/dist/esm/init.d.ts +0 -8
- package/dist/esm/init.js +4 -4
- package/dist/esm/utils/own-deps.js +8 -1
- package/dist/esm/utils/resolve-bin.d.ts +2 -0
- package/dist/esm/utils/resolve-bin.js +4 -0
- package/eslint-default-rules.json +2 -8
- package/eslint.config.mjs +37 -8
- package/install-manifests/commitlint/package-lock.json +5 -4
- package/install-manifests/core/package-lock.json +5 -3
- package/install-manifests/js/package-lock.json +250 -571
- package/install-manifests/js/package.json +10 -8
- package/install-manifests/markdown/package-lock.json +16 -13
- package/install-manifests/markdown/package.json +3 -0
- package/install-manifests/spellcheck/package-lock.json +3 -3
- package/package.json +19 -15
- package/src/config/.eslintrc.js +3 -9
- package/src/config/eslint-default-rules.json +2 -8
package/eslint.config.mjs
CHANGED
|
@@ -1,12 +1,41 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import { createRequire } from 'module';
|
|
3
3
|
import path from 'path';
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import
|
|
4
|
+
import { pathToFileURL } from 'url';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Plugins are loaded through the roots pr-checkmate registered for this run
|
|
8
|
+
* (`PR_CHECKMATE_TOOL_ROOTS`), because the `js` profile is fetched into a cache
|
|
9
|
+
* directory when a repository needs it and a bare `import` only searches the tree
|
|
10
|
+
* this file sits in. With no roots — development, or tooling that shipped beside
|
|
11
|
+
* the package — it is the plain import it always was.
|
|
12
|
+
*/
|
|
13
|
+
const toolRoots = (process.env.PR_CHECKMATE_TOOL_ROOTS ?? '').split(path.delimiter).filter(Boolean);
|
|
14
|
+
const resolveFrom = createRequire(import.meta.url);
|
|
15
|
+
|
|
16
|
+
async function loadPlugin(name) {
|
|
17
|
+
for (const root of toolRoots) {
|
|
18
|
+
try {
|
|
19
|
+
const entry = resolveFrom.resolve(name, { paths: [root] });
|
|
20
|
+
const mod = await import(pathToFileURL(entry).href);
|
|
21
|
+
|
|
22
|
+
return mod.default ?? mod;
|
|
23
|
+
} catch {}
|
|
24
|
+
}
|
|
25
|
+
const mod = await import(name);
|
|
26
|
+
|
|
27
|
+
return mod.default ?? mod;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const [tsPlugin, tsParser, prettierPlugin, sonarjsPlugin, jsdocPlugin, simpleImportSort] =
|
|
31
|
+
await Promise.all([
|
|
32
|
+
loadPlugin('@typescript-eslint/eslint-plugin'),
|
|
33
|
+
loadPlugin('@typescript-eslint/parser'),
|
|
34
|
+
loadPlugin('eslint-plugin-prettier'),
|
|
35
|
+
loadPlugin('eslint-plugin-sonarjs'),
|
|
36
|
+
loadPlugin('eslint-plugin-jsdoc'),
|
|
37
|
+
loadPlugin('eslint-plugin-simple-import-sort'),
|
|
38
|
+
]);
|
|
10
39
|
|
|
11
40
|
/**
|
|
12
41
|
* Default ESLint rules — single source of truth, shared with init.ts so the
|
|
@@ -15,7 +44,7 @@ import jsdocPlugin from 'eslint-plugin-jsdoc';
|
|
|
15
44
|
*
|
|
16
45
|
* SEVERITY POLICY: `error` is reserved for defects a human has to resolve —
|
|
17
46
|
* `no-debugger`, `eqeqeq`, `prefer-const`, `@typescript-eslint/no-unused-vars`,
|
|
18
|
-
* `@typescript-eslint/no-floating-promises`, `
|
|
47
|
+
* `@typescript-eslint/no-floating-promises`, `no-duplicate-imports`. Everything
|
|
19
48
|
* that is purely formatting is `warn`, even
|
|
20
49
|
* though it is auto-fixable, precisely BECAUSE it is auto-fixable: ESLint exits 1
|
|
21
50
|
* on errors only, and the ESLint check maps exit 1 to a blocking failure, so an
|
|
@@ -179,7 +208,7 @@ export default [
|
|
|
179
208
|
'@typescript-eslint': tsPlugin,
|
|
180
209
|
prettier: prettierPlugin,
|
|
181
210
|
sonarjs: sonarjsPlugin,
|
|
182
|
-
import:
|
|
211
|
+
'simple-import-sort': simpleImportSort,
|
|
183
212
|
jsdoc: jsdocPlugin,
|
|
184
213
|
},
|
|
185
214
|
|
|
@@ -421,6 +421,7 @@
|
|
|
421
421
|
"version": "26.6.2",
|
|
422
422
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.2.tgz",
|
|
423
423
|
"integrity": "sha512-X1P21scMv4zGKLYqjdGjaKa7COa0RKVYYZZN/NfvLQ1JegxFhdhpZG/Lyn8AXx6CDUavKAd11v6BvfpkDByK8g==",
|
|
424
|
+
"devOptional": true,
|
|
424
425
|
"license": "MIT",
|
|
425
426
|
"dependencies": {
|
|
426
427
|
"undici-types": "~8.9.0"
|
|
@@ -481,7 +482,6 @@
|
|
|
481
482
|
"version": "6.0.1",
|
|
482
483
|
"resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-6.0.1.tgz",
|
|
483
484
|
"integrity": "sha512-cs+LadpH7Kpw0M3k8wurk+sOVVDAENA0iK4OBOrkL94j5lEVYRJ4j3zd2bhY9qgzyrPqthdcYT3axzRN7AliMg==",
|
|
484
|
-
"devOptional": true,
|
|
485
485
|
"license": "MIT",
|
|
486
486
|
"engines": {
|
|
487
487
|
"node": ">=22"
|
|
@@ -616,9 +616,9 @@
|
|
|
616
616
|
"license": "MIT"
|
|
617
617
|
},
|
|
618
618
|
"node_modules/fast-uri": {
|
|
619
|
-
"version": "3.1.
|
|
620
|
-
"resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.
|
|
621
|
-
"integrity": "sha512-
|
|
619
|
+
"version": "3.1.9",
|
|
620
|
+
"resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.9.tgz",
|
|
621
|
+
"integrity": "sha512-hS/0Wt3Ya043oKXs0sIxrMpKQITXhMLIrVAKKXi4gozGC9v7YRWVnXIZzjNPTO02M9BdxLCWqK1yRXgNziVyJQ==",
|
|
622
622
|
"funding": [
|
|
623
623
|
{
|
|
624
624
|
"type": "github",
|
|
@@ -874,6 +874,7 @@
|
|
|
874
874
|
"version": "8.9.0",
|
|
875
875
|
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.9.0.tgz",
|
|
876
876
|
"integrity": "sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg==",
|
|
877
|
+
"devOptional": true,
|
|
877
878
|
"license": "MIT"
|
|
878
879
|
},
|
|
879
880
|
"node_modules/wrap-ansi": {
|
|
@@ -376,6 +376,7 @@
|
|
|
376
376
|
"version": "26.6.2",
|
|
377
377
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.2.tgz",
|
|
378
378
|
"integrity": "sha512-X1P21scMv4zGKLYqjdGjaKa7COa0RKVYYZZN/NfvLQ1JegxFhdhpZG/Lyn8AXx6CDUavKAd11v6BvfpkDByK8g==",
|
|
379
|
+
"devOptional": true,
|
|
379
380
|
"license": "MIT",
|
|
380
381
|
"dependencies": {
|
|
381
382
|
"undici-types": "~8.9.0"
|
|
@@ -906,9 +907,9 @@
|
|
|
906
907
|
}
|
|
907
908
|
},
|
|
908
909
|
"node_modules/toml": {
|
|
909
|
-
"version": "5.0.
|
|
910
|
-
"resolved": "https://registry.npmjs.org/toml/-/toml-5.0.
|
|
911
|
-
"integrity": "sha512-
|
|
910
|
+
"version": "5.0.1",
|
|
911
|
+
"resolved": "https://registry.npmjs.org/toml/-/toml-5.0.1.tgz",
|
|
912
|
+
"integrity": "sha512-EqYNA/YvUNndrA2B3O2ojzLQoTQrBxeZ9UIjQwk8t10oe6n7dwclBwd9IdZQTOKwe6vWX+AXtl6IntXRbepdxQ==",
|
|
912
913
|
"license": "MIT",
|
|
913
914
|
"engines": {
|
|
914
915
|
"node": ">=20"
|
|
@@ -918,6 +919,7 @@
|
|
|
918
919
|
"version": "8.9.0",
|
|
919
920
|
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.9.0.tgz",
|
|
920
921
|
"integrity": "sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg==",
|
|
922
|
+
"devOptional": true,
|
|
921
923
|
"license": "MIT"
|
|
922
924
|
},
|
|
923
925
|
"node_modules/unicorn-magic": {
|