@apdesign/code-style-react 1.2.1 → 1.2.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/package.json +1 -1
- package/scripts/runEslint.js +4 -2
package/package.json
CHANGED
package/scripts/runEslint.js
CHANGED
@@ -37,7 +37,8 @@ async function runEslint(targetPathArg) {
|
|
37
37
|
// targetPath 是第一个不是 --branch 的参数
|
38
38
|
let targetPath = process.cwd();
|
39
39
|
for (let i = 0; i < args.length; i++) {
|
40
|
-
|
40
|
+
// 仅当确实存在 --branch 参数时才跳过它和它的值
|
41
|
+
if (branchIndex !== -1 && (i === branchIndex || i === branchIndex + 1)) continue;
|
41
42
|
targetPath = args[i] || targetPath;
|
42
43
|
break;
|
43
44
|
}
|
@@ -146,7 +147,8 @@ async function runEslint(targetPathArg) {
|
|
146
147
|
const srcPath = path.join(rootDir, 'src');
|
147
148
|
const eslintTarget = fs.existsSync(srcPath) ? srcPath : '.';
|
148
149
|
if (!fs.existsSync(srcPath)) {
|
149
|
-
console.
|
150
|
+
console.error(`❌ 当前目录下不存在 src 文件夹`);
|
151
|
+
process.exit(1);
|
150
152
|
} else {
|
151
153
|
console.log(`🔍 检查目录: ${eslintTarget}`);
|
152
154
|
}
|