pr-checkmate 1.0.17 → 1.0.19
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/.prettierrc +8 -0
- package/cspell.json +35 -0
- package/dist/index.js +24 -61
- package/dist/scripts/copy-configs copy.js +1 -0
- package/eslint.config.mjs +73 -0
- package/package.json +8 -6
package/.prettierrc
ADDED
package/cspell.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.2",
|
|
3
|
+
"language": "en",
|
|
4
|
+
"words": [
|
|
5
|
+
"checkmate",
|
|
6
|
+
"eslint",
|
|
7
|
+
"prettier",
|
|
8
|
+
"cspell",
|
|
9
|
+
"typescript",
|
|
10
|
+
"execa",
|
|
11
|
+
"playwright",
|
|
12
|
+
"pytest"
|
|
13
|
+
],
|
|
14
|
+
"ignorePaths": [
|
|
15
|
+
"**/node_modules/**",
|
|
16
|
+
"**/dist/**",
|
|
17
|
+
"**/.git/**",
|
|
18
|
+
"**/build/**",
|
|
19
|
+
"**/coverage/**",
|
|
20
|
+
"**/.next/**",
|
|
21
|
+
"**/.nuxt/**",
|
|
22
|
+
"**/out/**",
|
|
23
|
+
"**/__pycache__/**",
|
|
24
|
+
"**/.pytest_cache/**",
|
|
25
|
+
"**/.venv/**",
|
|
26
|
+
"**/venv/**",
|
|
27
|
+
"**/package-lock.json",
|
|
28
|
+
"**/yarn.lock",
|
|
29
|
+
"**/pnpm-lock.yaml",
|
|
30
|
+
"**/*.min.js",
|
|
31
|
+
"**/*.min.css"
|
|
32
|
+
],
|
|
33
|
+
"enableFiletypes": ["typescript", "javascript", "markdown", "json"],
|
|
34
|
+
"ignoreRegExpList": ["/https?:\\/\\/[^\\s]+/g", "/\\b[0-9a-f]{7,40}\\b/gi"]
|
|
35
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -1,54 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.logger = exports.runSpellcheck = exports.runPrettier = exports.runDependencyCheck = exports.runLint = void 0;
|
|
4
|
+
exports.runAllChecks = runAllChecks;
|
|
5
|
+
exports.runChecks = runChecks;
|
|
2
6
|
/**
|
|
3
7
|
* PR CheckMate - Automated PR quality checks
|
|
4
8
|
*
|
|
5
9
|
* @module pr-checkmate
|
|
6
10
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
20
|
-
}) : function(o, v) {
|
|
21
|
-
o["default"] = v;
|
|
22
|
-
});
|
|
23
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
24
|
-
var ownKeys = function(o) {
|
|
25
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
26
|
-
var ar = [];
|
|
27
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
28
|
-
return ar;
|
|
29
|
-
};
|
|
30
|
-
return ownKeys(o);
|
|
31
|
-
};
|
|
32
|
-
return function (mod) {
|
|
33
|
-
if (mod && mod.__esModule) return mod;
|
|
34
|
-
var result = {};
|
|
35
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
36
|
-
__setModuleDefault(result, mod);
|
|
37
|
-
return result;
|
|
38
|
-
};
|
|
39
|
-
})();
|
|
40
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
-
exports.logger = exports.runSpellcheck = exports.runPrettier = exports.runDependencyCheck = exports.runLint = void 0;
|
|
42
|
-
exports.runAllChecks = runAllChecks;
|
|
43
|
-
exports.runChecks = runChecks;
|
|
44
|
-
var lint_1 = require("./scripts/lint");
|
|
45
|
-
Object.defineProperty(exports, "runLint", { enumerable: true, get: function () { return lint_1.runLint; } });
|
|
46
|
-
var dependency_check_1 = require("./scripts/dependency-check");
|
|
47
|
-
Object.defineProperty(exports, "runDependencyCheck", { enumerable: true, get: function () { return dependency_check_1.runDependencyCheck; } });
|
|
48
|
-
var prettier_autoformat_1 = require("./scripts/prettier-autoformat");
|
|
49
|
-
Object.defineProperty(exports, "runPrettier", { enumerable: true, get: function () { return prettier_autoformat_1.runPrettier; } });
|
|
50
|
-
var spellcheck_1 = require("./scripts/spellcheck");
|
|
51
|
-
Object.defineProperty(exports, "runSpellcheck", { enumerable: true, get: function () { return spellcheck_1.runSpellcheck; } });
|
|
11
|
+
const lint_1 = require("./scripts/lint");
|
|
12
|
+
const dependency_check_1 = require("./scripts/dependency-check");
|
|
13
|
+
const prettier_autoformat_1 = require("./scripts/prettier-autoformat");
|
|
14
|
+
const spellcheck_1 = require("./scripts/spellcheck");
|
|
15
|
+
var lint_2 = require("./scripts/lint");
|
|
16
|
+
Object.defineProperty(exports, "runLint", { enumerable: true, get: function () { return lint_2.runLint; } });
|
|
17
|
+
var dependency_check_2 = require("./scripts/dependency-check");
|
|
18
|
+
Object.defineProperty(exports, "runDependencyCheck", { enumerable: true, get: function () { return dependency_check_2.runDependencyCheck; } });
|
|
19
|
+
var prettier_autoformat_2 = require("./scripts/prettier-autoformat");
|
|
20
|
+
Object.defineProperty(exports, "runPrettier", { enumerable: true, get: function () { return prettier_autoformat_2.runPrettier; } });
|
|
21
|
+
var spellcheck_2 = require("./scripts/spellcheck");
|
|
22
|
+
Object.defineProperty(exports, "runSpellcheck", { enumerable: true, get: function () { return spellcheck_2.runSpellcheck; } });
|
|
52
23
|
var utils_1 = require("./utils");
|
|
53
24
|
Object.defineProperty(exports, "logger", { enumerable: true, get: function () { return utils_1.logger; } });
|
|
54
25
|
/**
|
|
@@ -56,29 +27,21 @@ Object.defineProperty(exports, "logger", { enumerable: true, get: function () {
|
|
|
56
27
|
* @returns Promise that resolves when all checks complete
|
|
57
28
|
*/
|
|
58
29
|
async function runAllChecks() {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
await runLint();
|
|
64
|
-
await runDependencyCheck();
|
|
65
|
-
await runSpellcheck();
|
|
66
|
-
await runPrettier(); // Last to commit any fixes
|
|
30
|
+
await (0, lint_1.runLint)();
|
|
31
|
+
await (0, dependency_check_1.runDependencyCheck)();
|
|
32
|
+
await (0, spellcheck_1.runSpellcheck)();
|
|
33
|
+
await (0, prettier_autoformat_1.runPrettier)(); // Last to commit any fixes
|
|
67
34
|
}
|
|
68
35
|
/**
|
|
69
36
|
* Run checks based on configuration
|
|
70
37
|
*/
|
|
71
38
|
async function runChecks(config = {}) {
|
|
72
|
-
const { runLint } = await Promise.resolve().then(() => __importStar(require('./scripts/lint')));
|
|
73
|
-
const { runDependencyCheck } = await Promise.resolve().then(() => __importStar(require('./scripts/dependency-check')));
|
|
74
|
-
const { runPrettier } = await Promise.resolve().then(() => __importStar(require('./scripts/prettier-autoformat')));
|
|
75
|
-
const { runSpellcheck } = await Promise.resolve().then(() => __importStar(require('./scripts/spellcheck')));
|
|
76
39
|
if (!config.skipLint)
|
|
77
|
-
await runLint();
|
|
40
|
+
await (0, lint_1.runLint)();
|
|
78
41
|
if (!config.skipDeps)
|
|
79
|
-
await runDependencyCheck();
|
|
42
|
+
await (0, dependency_check_1.runDependencyCheck)();
|
|
80
43
|
if (!config.skipSpell)
|
|
81
|
-
await runSpellcheck();
|
|
44
|
+
await (0, spellcheck_1.runSpellcheck)();
|
|
82
45
|
if (!config.skipFormat && config.autoCommit)
|
|
83
|
-
await runPrettier();
|
|
46
|
+
await (0, prettier_autoformat_1.runPrettier)();
|
|
84
47
|
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import tsPlugin from '@typescript-eslint/eslint-plugin';
|
|
2
|
+
import tsParser from '@typescript-eslint/parser';
|
|
3
|
+
import prettierPlugin from 'eslint-plugin-prettier';
|
|
4
|
+
|
|
5
|
+
export default [
|
|
6
|
+
{
|
|
7
|
+
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
|
|
8
|
+
ignores: [
|
|
9
|
+
'**/node_modules/**',
|
|
10
|
+
'**/dist/**',
|
|
11
|
+
'**/.git/**',
|
|
12
|
+
'**/build/**',
|
|
13
|
+
'**/coverage/**',
|
|
14
|
+
'**/.next/**',
|
|
15
|
+
'**/.nuxt/**',
|
|
16
|
+
'**/out/**',
|
|
17
|
+
],
|
|
18
|
+
languageOptions: {
|
|
19
|
+
parser: tsParser,
|
|
20
|
+
parserOptions: {
|
|
21
|
+
ecmaVersion: 2020,
|
|
22
|
+
sourceType: 'module',
|
|
23
|
+
project: './tsconfig.json',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
plugins: {
|
|
28
|
+
'@typescript-eslint': tsPlugin,
|
|
29
|
+
prettier: prettierPlugin,
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
rules: {
|
|
33
|
+
'no-console': 'warn',
|
|
34
|
+
'no-debugger': 'error',
|
|
35
|
+
'prefer-const': 'error',
|
|
36
|
+
eqeqeq: ['error', 'always'],
|
|
37
|
+
'@typescript-eslint/no-unused-vars': [
|
|
38
|
+
'error',
|
|
39
|
+
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
|
|
40
|
+
],
|
|
41
|
+
'@typescript-eslint/explicit-function-return-type': ['warn'],
|
|
42
|
+
'@typescript-eslint/no-explicit-any': ['warn'],
|
|
43
|
+
'@typescript-eslint/no-floating-promises': ['error'],
|
|
44
|
+
'space-before-function-paren': 'off',
|
|
45
|
+
'operator-linebreak': 'off',
|
|
46
|
+
'max-len': ['warn', { code: 100 }],
|
|
47
|
+
|
|
48
|
+
// Formatting / Style Rules
|
|
49
|
+
semi: ['error', 'always'],
|
|
50
|
+
quotes: ['error', 'single', { avoidEscape: true }],
|
|
51
|
+
'object-curly-spacing': ['error', 'always'],
|
|
52
|
+
'space-infix-ops': 'error',
|
|
53
|
+
'keyword-spacing': ['error', { before: true, after: true }],
|
|
54
|
+
'padding-line-between-statements': [
|
|
55
|
+
'error',
|
|
56
|
+
{ blankLine: 'always', prev: 'block', next: '*' },
|
|
57
|
+
{ blankLine: 'always', prev: '*', next: 'return' },
|
|
58
|
+
],
|
|
59
|
+
|
|
60
|
+
// Prettier integration
|
|
61
|
+
'prettier/prettier': [
|
|
62
|
+
'error',
|
|
63
|
+
{
|
|
64
|
+
semi: true,
|
|
65
|
+
singleQuote: true,
|
|
66
|
+
bracketSpacing: true,
|
|
67
|
+
arrowParens: 'avoid',
|
|
68
|
+
printWidth: 100,
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pr-checkmate",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.19",
|
|
4
4
|
"description": "Automated PR quality checks: linting, formatting, dependency analysis, and spellcheck",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"github-actions",
|
|
@@ -20,6 +20,9 @@
|
|
|
20
20
|
"dist",
|
|
21
21
|
"README.md",
|
|
22
22
|
"scripts/copy-configs.js",
|
|
23
|
+
"eslint.config.mjs",
|
|
24
|
+
".prettierrc",
|
|
25
|
+
"cspell.json",
|
|
23
26
|
"LICENSE"
|
|
24
27
|
],
|
|
25
28
|
"scripts": {
|
|
@@ -56,15 +59,14 @@
|
|
|
56
59
|
"inquirer": "^13.0.1",
|
|
57
60
|
"prettier": ">=3.0.0",
|
|
58
61
|
"ts-node": "^10.9.1",
|
|
59
|
-
"typescript": "^5.9.3"
|
|
60
|
-
},
|
|
61
|
-
"devDependencies": {
|
|
62
|
-
"@types/inquirer": "^9.0.9",
|
|
62
|
+
"typescript": "^5.9.3",
|
|
63
63
|
"@typescript-eslint/eslint-plugin": "^8.47.0",
|
|
64
64
|
"@typescript-eslint/parser": "^8.47.0",
|
|
65
65
|
"eslint-config-prettier": "^9.1.2",
|
|
66
66
|
"eslint-plugin-import": "^2.29.0",
|
|
67
|
-
"eslint-plugin-prettier": "^5.5.4"
|
|
67
|
+
"eslint-plugin-prettier": "^5.5.4"
|
|
68
|
+
},
|
|
69
|
+
"devDependencies": {
|
|
68
70
|
"standard-version": "^9.5.0"
|
|
69
71
|
},
|
|
70
72
|
"peerDependencies": {
|