mirror of
https://github.com/Microsoft/vscode
synced 2024-10-04 02:14:06 +00:00
makes eslint fail the hygiene checks
This commit is contained in:
parent
324764a4df
commit
e6d9b41a8c
|
@ -191,7 +191,11 @@ gulp.task('eslint', () => {
|
|||
rulePaths: ['./build/lib/eslint']
|
||||
}))
|
||||
.pipe(gulpeslint.formatEach('compact'))
|
||||
.pipe(gulpeslint.failAfterError());
|
||||
.pipe(gulpeslint.results(results => {
|
||||
if (results.warningCount > 0 || results.errorCount > 0) {
|
||||
throw new Error('eslint failed with warnings and/or errors');
|
||||
}
|
||||
}));
|
||||
});
|
||||
|
||||
gulp.task('tslint', () => {
|
||||
|
@ -307,7 +311,7 @@ function hygiene(some) {
|
|||
let formatted = result.dest.replace(/\r\n/gm, '\n');
|
||||
|
||||
if (original !== formatted) {
|
||||
console.error("File not formatted. Run the 'Format Document' command to fix it:", file.relative);
|
||||
console.error('File not formatted. Run the \'Format Document\' command to fix it:', file.relative);
|
||||
errorCount++;
|
||||
}
|
||||
cb(null, file);
|
||||
|
@ -367,7 +371,10 @@ function hygiene(some) {
|
|||
rulePaths: ['./build/lib/eslint']
|
||||
}))
|
||||
.pipe(gulpeslint.formatEach('compact'))
|
||||
.pipe(gulpeslint.failAfterError());
|
||||
.pipe(gulpeslint.results(results => {
|
||||
errorCount += results.warningCount;
|
||||
errorCount += results.errorCount;
|
||||
}));
|
||||
|
||||
let count = 0;
|
||||
return es.merge(typescript, javascript)
|
||||
|
|
Loading…
Reference in a new issue