Skip to content

Commit 3371898

Browse files
committed
fix lint errors
1 parent 448115e commit 3371898

2 files changed

Lines changed: 177 additions & 181 deletions

File tree

build/gulpfile.hygiene.js

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,40 +3,38 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
"use strict";
6+
const gulp = require('gulp');
7+
const filter = require('gulp-filter');
8+
const es = require('event-stream');
9+
const gulpeslint = require('gulp-eslint');
10+
const vfs = require('vinyl-fs');
11+
const path = require('path');
12+
const task = require('./lib/task');
13+
const { all, jsHygieneFilter, tsHygieneFilter, hygiene } = require('./hygiene');
714

8-
const gulp = require("gulp");
9-
const filter = require("gulp-filter");
10-
const es = require("event-stream");
11-
const gulpeslint = require("gulp-eslint");
12-
const vfs = require("vinyl-fs");
13-
const path = require("path");
14-
const task = require("./lib/task");
15-
const { all, jsHygieneFilter, tsHygieneFilter, hygiene } = require("./hygiene");
16-
17-
gulp.task("eslint", () => {
15+
gulp.task('eslint', () => {
1816
return vfs
19-
.src(all, { base: ".", follow: true, allowEmpty: true })
17+
.src(all, { base: '.', follow: true, allowEmpty: true })
2018
.pipe(filter(jsHygieneFilter.concat(tsHygieneFilter)))
2119
.pipe(
2220
gulpeslint({
23-
configFile: ".eslintrc.json",
24-
rulePaths: ["./build/lib/eslint"],
21+
configFile: '.eslintrc.json',
22+
rulePaths: ['./build/lib/eslint'],
2523
})
2624
)
27-
.pipe(gulpeslint.formatEach("compact"))
25+
.pipe(gulpeslint.formatEach('compact'))
2826
.pipe(
2927
gulpeslint.results((results) => {
3028
if (results.warningCount > 0 || results.errorCount > 0) {
31-
throw new Error("eslint failed with warnings and/or errors");
29+
throw new Error('eslint failed with warnings and/or errors');
3230
}
3331
})
3432
);
3533
});
3634

3735
function checkPackageJSON(actualPath) {
38-
const actual = require(path.join(__dirname, "..", actualPath));
39-
const rootPackageJSON = require("../package.json");
36+
const actual = require(path.join(__dirname, '..', actualPath));
37+
const rootPackageJSON = require('../package.json');
4038

4139
for (let depName in actual.dependencies) {
4240
const depVersion = actual.dependencies[depName];
@@ -47,24 +45,24 @@ function checkPackageJSON(actualPath) {
4745
}
4846
if (depVersion !== rootDepVersion) {
4947
this.emit(
50-
"error",
48+
'error',
5149
`The dependency ${depName} in '${actualPath}' (${depVersion}) is different than in the root package.json (${rootDepVersion})`
5250
);
5351
}
5452
}
5553
}
5654

57-
const checkPackageJSONTask = task.define("check-package-json", () => {
58-
return gulp.src("package.json").pipe(
55+
const checkPackageJSONTask = task.define('check-package-json', () => {
56+
return gulp.src('package.json').pipe(
5957
es.through(function () {
60-
checkPackageJSON.call(this, "remote/package.json");
61-
checkPackageJSON.call(this, "remote/web/package.json");
58+
checkPackageJSON.call(this, 'remote/package.json');
59+
checkPackageJSON.call(this, 'remote/web/package.json');
6260
})
6361
);
6462
});
6563
gulp.task(checkPackageJSONTask);
6664

6765
gulp.task(
68-
"hygiene",
66+
'hygiene',
6967
task.series(checkPackageJSONTask, () => hygiene())
7068
);

0 commit comments

Comments
 (0)