pr-checkmate 1.0.11 â 1.0.13
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/dist/.prettierrc +8 -0
- package/dist/cspell.json +35 -0
- package/dist/eslint.config.mjs +73 -0
- package/dist/scripts/copy-configs copy.js +49 -0
- package/dist/scripts/copy-configs.js +25 -11
- package/package.json +5 -3
package/dist/.prettierrc
ADDED
package/dist/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
|
+
}
|
|
@@ -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
|
+
];
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// import fs from 'node:fs';
|
|
3
|
+
// import path from 'node:path';
|
|
4
|
+
// import { logger } from '../utils';
|
|
5
|
+
// interface ConfigFile {
|
|
6
|
+
// source: string;
|
|
7
|
+
// dest: string;
|
|
8
|
+
// }
|
|
9
|
+
// const configFiles: ConfigFile[] = [
|
|
10
|
+
// {
|
|
11
|
+
// source: 'src/config/eslint.config.mjs',
|
|
12
|
+
// dest: 'eslint.config.mjs',
|
|
13
|
+
// },
|
|
14
|
+
// {
|
|
15
|
+
// source: 'src/config/.prettierrc',
|
|
16
|
+
// dest: '.prettierrc',
|
|
17
|
+
// },
|
|
18
|
+
// {
|
|
19
|
+
// source: 'src/config/cspell.json',
|
|
20
|
+
// dest: 'cspell.json',
|
|
21
|
+
// },
|
|
22
|
+
// ];
|
|
23
|
+
// /**
|
|
24
|
+
// * Copy configuration files from src/config to dist/
|
|
25
|
+
// */
|
|
26
|
+
// function copyConfigs(): void {
|
|
27
|
+
// const projectRoot = path.resolve(__dirname, '../..');
|
|
28
|
+
// const distDir = path.join(projectRoot, 'dist');
|
|
29
|
+
// if (!fs.existsSync(distDir)) {
|
|
30
|
+
// fs.mkdirSync(distDir, { recursive: true });
|
|
31
|
+
// }
|
|
32
|
+
// logger.log('đŚ Copying configuration files...\n');
|
|
33
|
+
// configFiles.forEach(({ source, dest }) => {
|
|
34
|
+
// const srcPath = path.join(projectRoot, source);
|
|
35
|
+
// const destPath = path.join(distDir, dest);
|
|
36
|
+
// if (fs.existsSync(srcPath)) {
|
|
37
|
+
// fs.copyFileSync(srcPath, destPath);
|
|
38
|
+
// logger.log(`â
Copied ${dest}`);
|
|
39
|
+
// } else {
|
|
40
|
+
// logger.warn(`â ď¸ File not found: ${source}`);
|
|
41
|
+
// }
|
|
42
|
+
// });
|
|
43
|
+
// logger.info('\n⨠Config files copied successfully!\n');
|
|
44
|
+
// }
|
|
45
|
+
// // Run if called directly
|
|
46
|
+
// if (require.main === module) {
|
|
47
|
+
// copyConfigs();
|
|
48
|
+
// }
|
|
49
|
+
// export { copyConfigs };
|
|
@@ -7,30 +7,44 @@ exports.copyConfigs = copyConfigs;
|
|
|
7
7
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
8
|
const node_path_1 = __importDefault(require("node:path"));
|
|
9
9
|
const utils_1 = require("../utils");
|
|
10
|
+
/**
|
|
11
|
+
* Safe way to detect package root even when running from dist/
|
|
12
|
+
*/
|
|
13
|
+
function findPackageRoot() {
|
|
14
|
+
let dir = __dirname;
|
|
15
|
+
while (!node_fs_1.default.existsSync(node_path_1.default.join(dir, 'package.json'))) {
|
|
16
|
+
const parent = node_path_1.default.resolve(dir, '..');
|
|
17
|
+
if (parent === dir)
|
|
18
|
+
break; // reached filesystem root
|
|
19
|
+
dir = parent;
|
|
20
|
+
}
|
|
21
|
+
return dir;
|
|
22
|
+
}
|
|
10
23
|
const configFiles = [
|
|
11
24
|
{ source: 'src/config/eslint.config.mjs', dest: 'eslint.config.mjs' },
|
|
12
25
|
{ source: 'src/config/.prettierrc', dest: '.prettierrc' },
|
|
13
26
|
{ source: 'src/config/cspell.json', dest: 'cspell.json' },
|
|
14
27
|
];
|
|
15
|
-
/**
|
|
16
|
-
* Copy configuration files to package root (NOT dist!)
|
|
17
|
-
*/
|
|
18
28
|
function copyConfigs() {
|
|
19
|
-
const
|
|
20
|
-
|
|
29
|
+
const root = findPackageRoot();
|
|
30
|
+
const distDir = node_path_1.default.join(root, 'dist');
|
|
31
|
+
utils_1.logger.log('đŚ Copying configuration files...\n');
|
|
21
32
|
configFiles.forEach(({ source, dest }) => {
|
|
22
|
-
const srcPath = node_path_1.default.join(
|
|
23
|
-
const
|
|
33
|
+
const srcPath = node_path_1.default.join(root, source);
|
|
34
|
+
const destRoot = node_path_1.default.join(root, dest);
|
|
35
|
+
const destDist = node_path_1.default.join(distDir, dest);
|
|
24
36
|
if (node_fs_1.default.existsSync(srcPath)) {
|
|
25
|
-
node_fs_1.default.copyFileSync(srcPath,
|
|
26
|
-
|
|
37
|
+
node_fs_1.default.copyFileSync(srcPath, destRoot);
|
|
38
|
+
node_fs_1.default.copyFileSync(srcPath, destDist);
|
|
39
|
+
utils_1.logger.log(`â
Copied: ${dest}`);
|
|
27
40
|
}
|
|
28
41
|
else {
|
|
29
|
-
utils_1.logger.warn(`â ď¸
|
|
42
|
+
utils_1.logger.warn(`â ď¸ Missing file: ${source}`);
|
|
30
43
|
}
|
|
31
44
|
});
|
|
32
|
-
utils_1.logger.info('\n⨠Config files copied
|
|
45
|
+
utils_1.logger.info('\n⨠Config files copied!\n');
|
|
33
46
|
}
|
|
47
|
+
// Execute if run directly
|
|
34
48
|
if (require.main === module) {
|
|
35
49
|
copyConfigs();
|
|
36
50
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pr-checkmate",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.13",
|
|
4
4
|
"description": "Automated PR quality checks: linting, formatting, dependency analysis, and spellcheck",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"github-actions",
|
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
"prettier": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,md}\"",
|
|
32
32
|
"spellcheck": "cspell '**/*.{ts,tsx,js,jsx,md,json}' --no-progress",
|
|
33
33
|
"test": "echo 'Tests coming soon'",
|
|
34
|
-
"clean": "rm -rf dist"
|
|
34
|
+
"clean": "rm -rf dist",
|
|
35
|
+
"release": "standard-version"
|
|
35
36
|
},
|
|
36
37
|
"engines": {
|
|
37
38
|
"node": ">=18.0.0",
|
|
@@ -63,7 +64,8 @@
|
|
|
63
64
|
"@typescript-eslint/parser": "^8.47.0",
|
|
64
65
|
"eslint-config-prettier": "^9.1.2",
|
|
65
66
|
"eslint-plugin-import": "^2.29.0",
|
|
66
|
-
"eslint-plugin-prettier": "^5.5.4"
|
|
67
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
68
|
+
"standard-version": "^9.5.0"
|
|
67
69
|
},
|
|
68
70
|
"peerDependencies": {
|
|
69
71
|
"eslint": ">=8.0.0",
|