pr-checkmate 1.20.0 → 1.20.2
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 +2 -0
- package/dist/scripts/lint.js +18 -1
- package/eslint.config.mjs +6 -1
- package/package.json +5 -4
- package/src/config/.eslintrc.js +2 -0
- package/src/config/eslint.config.mjs +6 -1
package/.eslintrc.js
CHANGED
package/dist/scripts/lint.js
CHANGED
|
@@ -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
|
-
|
|
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/eslint.config.mjs
CHANGED
|
@@ -100,6 +100,8 @@ const mergedRules = {
|
|
|
100
100
|
// Merge default ignores with user-defined ignores
|
|
101
101
|
const mergedIgnores = [
|
|
102
102
|
...defaultIgnores,
|
|
103
|
+
'**/.eslintrc.js',
|
|
104
|
+
'**/eslint.config.mjs',
|
|
103
105
|
...(userConfig.eslint?.ignorePatterns || []),
|
|
104
106
|
];
|
|
105
107
|
|
|
@@ -117,9 +119,12 @@ if (customIgnoresCount > 0) {
|
|
|
117
119
|
console.log(`📋 ESLint checking: ${SRC}/**/*.{ts,tsx,js,jsx}`);
|
|
118
120
|
|
|
119
121
|
export default [
|
|
122
|
+
// Global ignores must be in a separate config object
|
|
120
123
|
{
|
|
121
|
-
files: [`${SRC}/**/*.{ts,tsx,js,jsx}`],
|
|
122
124
|
ignores: mergedIgnores,
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
files: [`${SRC}/**/*.{ts,tsx,js,jsx}`],
|
|
123
128
|
|
|
124
129
|
languageOptions: {
|
|
125
130
|
parser: tsParser,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pr-checkmate",
|
|
3
|
-
"version": "1.20.
|
|
3
|
+
"version": "1.20.2",
|
|
4
4
|
"description": "Automated PR quality checks: linting, formatting, dependency analysis, and spellcheck",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"github-actions",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"@typescript-eslint/parser": "^8.47.0",
|
|
67
67
|
"cspell": "^9.3.2",
|
|
68
68
|
"dotenv": "^17.2.3",
|
|
69
|
-
"eslint": "
|
|
69
|
+
"eslint": "^9.26.0",
|
|
70
70
|
"eslint-config-prettier": "^9.1.2",
|
|
71
71
|
"eslint-plugin-import": "^2.29.0",
|
|
72
72
|
"eslint-plugin-prettier": "^5.5.4",
|
|
@@ -81,10 +81,11 @@
|
|
|
81
81
|
"standard-version": "^9.5.0"
|
|
82
82
|
},
|
|
83
83
|
"peerDependencies": {
|
|
84
|
-
"eslint": "
|
|
84
|
+
"eslint": "^9.26.0",
|
|
85
85
|
"prettier": ">=3.0.0"
|
|
86
86
|
},
|
|
87
87
|
"overrides": {
|
|
88
|
-
"tar": "^7.5.7"
|
|
88
|
+
"tar": "^7.5.7",
|
|
89
|
+
"diff": "^5.0.0"
|
|
89
90
|
}
|
|
90
91
|
}
|
package/src/config/.eslintrc.js
CHANGED
|
@@ -100,6 +100,8 @@ const mergedRules = {
|
|
|
100
100
|
// Merge default ignores with user-defined ignores
|
|
101
101
|
const mergedIgnores = [
|
|
102
102
|
...defaultIgnores,
|
|
103
|
+
'**/.eslintrc.js',
|
|
104
|
+
'**/eslint.config.mjs',
|
|
103
105
|
...(userConfig.eslint?.ignorePatterns || []),
|
|
104
106
|
];
|
|
105
107
|
|
|
@@ -117,9 +119,12 @@ if (customIgnoresCount > 0) {
|
|
|
117
119
|
console.log(`📋 ESLint checking: ${SRC}/**/*.{ts,tsx,js,jsx}`);
|
|
118
120
|
|
|
119
121
|
export default [
|
|
122
|
+
// Global ignores must be in a separate config object
|
|
120
123
|
{
|
|
121
|
-
files: [`${SRC}/**/*.{ts,tsx,js,jsx}`],
|
|
122
124
|
ignores: mergedIgnores,
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
files: [`${SRC}/**/*.{ts,tsx,js,jsx}`],
|
|
123
128
|
|
|
124
129
|
languageOptions: {
|
|
125
130
|
parser: tsParser,
|