Skip to content

Commit

Permalink
feat: 优化错误提示
Browse files Browse the repository at this point in the history
  • Loading branch information
geekdada committed Jan 1, 2021
1 parent 6690cd9 commit 6e882a4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/command/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ class GenerateCommand extends Command {
const result = await checkAndFix(ctx.cwd);

if (!result) {
throw new Error('ESLint 测试不通过');
throw new Error('JS 语法检查不通过,请根据提示修改文件');
}
}

const config = loadConfig(ctx.cwd, ctx.argv.config, {
// istanbul ignore next
...(ctx.argv.output
? {
output: path.resolve(ctx.cwd, ctx.argv.output),
}
output: path.resolve(ctx.cwd, ctx.argv.output),
}
: null),
});

Expand Down
2 changes: 1 addition & 1 deletion lib/command/lint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class LintCommand extends Command {
}

if (!result) {
console.log('⚠️ JS 语法检查不通过,请根据提示修改文件');
console.warn('⚠️ JS 语法检查不通过,请根据提示修改文件');
process.exit(1);
} else {
console.log('✅ JS 语法检查通过');
Expand Down

0 comments on commit 6e882a4

Please sign in to comment.