Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/build/eslint.js
3520 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
// @ts-check
6
const es = require('event-stream');
7
const vfs = require('vinyl-fs');
8
const { eslintFilter } = require('./filters');
9
10
function eslint() {
11
const eslint = require('./gulp-eslint');
12
return vfs
13
.src(eslintFilter, { base: '.', follow: true, allowEmpty: true })
14
.pipe(
15
eslint((results) => {
16
if (results.warningCount > 0 || results.errorCount > 0) {
17
throw new Error('eslint failed with warnings and/or errors');
18
}
19
})
20
).pipe(es.through(function () { /* noop, important for the stream to end */ }));
21
}
22
23
if (require.main === module) {
24
eslint().on('error', (err) => {
25
console.error();
26
console.error(err);
27
process.exit(1);
28
});
29
}
30
31