Skip to content

Commit 39bf20f

Browse files
committed
fix(lint): 优化lint提示
1 parent 703ef3b commit 39bf20f

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/commands/lint.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ exports.run = function (options) {
1818
], (err, results) => {
1919
if (!err) {
2020
if (results[0] && results[1]) {
21-
success('All Files Complete!');
21+
success('All files complete without error.');
2222
}
2323
} else if (err === true) {
2424
error('Lint Error!');

src/models/Project.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ class Project {
142142
config.plugins.push(new ExtractTextPlugin(config.output.filename.replace('[ext]', '.css')));
143143
}
144144
lint(callback) {
145-
warn('Lint JS Files ......');
145+
warn('Linting JS Files ...');
146146
this.eslintConfig.useEslintrc = false;
147147

148148
const jsExtNames = this.config._config.entryExtNames.js,
@@ -161,11 +161,15 @@ class Project {
161161
)
162162
),
163163
formatter = cli.getFormatter();
164-
info(formatter(report.results));
164+
165+
if(report.errorCount > 0){
166+
info(formatter(report.results));
167+
}
168+
165169
callback(null, !report.errorCount);
166170
}
167171
lintCss(callback) {
168-
warn('Lint CSS Files ......');
172+
warn('Linting CSS Files ...');
169173

170174
const cssExtNames = this.config._config.entryExtNames.css,
171175
cssLintPath = cssExtNames.map((cssExt) => {

0 commit comments

Comments
 (0)