Skip to content

Commit

Permalink
enh: remove gulp-eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
mjeanroy committed Sep 5, 2023
1 parent 36349fe commit 0d38e98
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
"gulp": "4.0.2",
"gulp-bump": "3.2.0",
"gulp-conventional-changelog": "4.0.0",
"gulp-eslint": "6.0.0",
"gulp-git": "2.10.1",
"gulp-jasmine": "4.0.0",
"jasmine": "3.10.0",
Expand Down
25 changes: 17 additions & 8 deletions scripts/lint/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
*/

const path = require('path');
const gulp = require('gulp');
const log = require('../log');
const config = require('../config');

Expand All @@ -35,8 +34,7 @@ module.exports = function lint() {
return Promise.resolve();
}

const eslint = require('gulp-eslint');
const src = [
const inputs = [
path.join(config.root, '*.js'),
path.join(config.src, '**', '*.js'),
path.join(config.test, '**', '*.js'),
Expand All @@ -50,12 +48,23 @@ module.exports = function lint() {

log.debug('Linting files: ');

src.forEach((input) => (
inputs.forEach((input) => (
log.debug(` ${input}`)
));

return gulp.src(src)
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
const {ESLint} = require('eslint');
const fancyLog = require('fancy-log');
const eslint = new ESLint({
errorOnUnmatchedPattern: false,
});

const lintFiles = eslint.lintFiles(inputs);
const loadFormatter = eslint.loadFormatter('stylish');

return Promise.all([lintFiles, loadFormatter]).then(([results, formatter]) => {
if (results.errorCount > 0 || results.warningCount > 0) {
fancyLog(formatter.format(results));
throw new Error('ESLintError');
}
});
};

0 comments on commit 0d38e98

Please sign in to comment.