pr-checkmate 1.20.1 → 1.20.3

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.
@@ -8,6 +8,19 @@ const config_1 = require("../config");
8
8
  const utils_1 = require("../utils");
9
9
  const execa_1 = require("execa");
10
10
  const node_path_1 = __importDefault(require("node:path"));
11
+ /**
12
+ * Detect ESLint major version to choose appropriate config format
13
+ */
14
+ async function getESLintMajorVersion() {
15
+ try {
16
+ const { stdout } = await (0, execa_1.execa)('npx', ['eslint', '--version']);
17
+ const match = stdout.match(/v?(\d+)\./);
18
+ return match ? parseInt(match[1], 10) : 8;
19
+ }
20
+ catch {
21
+ return 8; // Default to 8 if detection fails
22
+ }
23
+ }
11
24
  async function runLint() {
12
25
  utils_1.logger.info('[runLint]: 🔍 Running ESLint...');
13
26
  const projectRoot = process.cwd();
@@ -27,7 +40,11 @@ async function runLint() {
27
40
  }
28
41
  else {
29
42
  utils_1.logger.info(`📦 Using pr-checkmate ESLint config (checking: ${sourcePath})`);
30
- const configPath = (0, config_1.getPackageConfigPath)('.eslintrc.js');
43
+ // Detect ESLint version and choose appropriate config
44
+ const eslintVersion = await getESLintMajorVersion();
45
+ const configFile = eslintVersion >= 9 ? 'eslint.config.mjs' : '.eslintrc.js';
46
+ const configPath = (0, config_1.getPackageConfigPath)(configFile);
47
+ utils_1.logger.info(`[runLint]: 📋 Detected ESLint v${eslintVersion}, using ${configFile}`);
31
48
  args = [
32
49
  'eslint',
33
50
  sourceFullPath,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pr-checkmate",
3
- "version": "1.20.1",
3
+ "version": "1.20.3",
4
4
  "description": "Automated PR quality checks: linting, formatting, dependency analysis, and spellcheck",
5
5
  "keywords": [
6
6
  "github-actions",
@@ -71,7 +71,7 @@
71
71
  "eslint-plugin-import": "^2.29.0",
72
72
  "eslint-plugin-prettier": "^5.5.4",
73
73
  "execa": "^9.6.0",
74
- "gitleaks-secret-scanner": "^2.1.1",
74
+ "gitleaks-secret-scanner-fixed": "^2.1.3",
75
75
  "inquirer": "^13.0.1",
76
76
  "prettier": ">=3.0.0",
77
77
  "ts-node": "^10.9.1",
@@ -83,9 +83,5 @@
83
83
  "peerDependencies": {
84
84
  "eslint": "^9.26.0",
85
85
  "prettier": ">=3.0.0"
86
- },
87
- "overrides": {
88
- "tar": "^7.5.7",
89
- "diff": "^5.0.0"
90
86
  }
91
87
  }