better hygiene task definition
This commit is contained in:
parent
af6d164f73
commit
271d9b8c00
|
@ -37,18 +37,18 @@ function checkPackageJSON(actualPath) {
|
|||
const rootPackageJSON = require('../package.json');
|
||||
const checkIncluded = (set1, set2) => {
|
||||
for (let depName in set1) {
|
||||
const depVersion = set1[depName];
|
||||
const rootDepVersion = set2[depName];
|
||||
if (!rootDepVersion) {
|
||||
// missing in root is allowed
|
||||
continue;
|
||||
}
|
||||
if (depVersion !== rootDepVersion) {
|
||||
this.emit(
|
||||
'error',
|
||||
`The dependency ${depName} in '${actualPath}' (${depVersion}) is different than in the root package.json (${rootDepVersion})`
|
||||
);
|
||||
}
|
||||
const depVersion = set1[depName];
|
||||
const rootDepVersion = set2[depName];
|
||||
if (!rootDepVersion) {
|
||||
// missing in root is allowed
|
||||
continue;
|
||||
}
|
||||
if (depVersion !== rootDepVersion) {
|
||||
this.emit(
|
||||
'error',
|
||||
`The dependency ${depName} in '${actualPath}' (${depVersion}) is different than in the root package.json (${rootDepVersion})`
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -67,7 +67,5 @@ const checkPackageJSONTask = task.define('check-package-json', () => {
|
|||
});
|
||||
gulp.task(checkPackageJSONTask);
|
||||
|
||||
gulp.task(
|
||||
'hygiene',
|
||||
task.series(checkPackageJSONTask, () => hygiene())
|
||||
);
|
||||
const hygieneTask = task.define('hygiene', task.series(checkPackageJSONTask, () => hygiene()));
|
||||
gulp.task(hygieneTask);
|
||||
|
|
Loading…
Reference in a new issue