@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apdesign/code-style-react",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "scripts": {},
5
5
  "bin": {
6
6
  "apdesign-code-style": "cli.js"
@@ -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
- if (i === branchIndex || i === branchIndex + 1) continue;
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.warn(`🔍 src 文件夹不存在,改为检查当前目录: ${eslintTarget}`);
150
+ console.error(`❌ 当前目录下不存在 src 文件夹`);
151
+ process.exit(1);
150
152
  } else {
151
153
  console.log(`🔍 检查目录: ${eslintTarget}`);
152
154
  }