scramjet-core
Advanced tools
Comparing version 4.32.0 to 4.32.1
{ | ||
"name": "scramjet-core", | ||
"version": "4.32.0", | ||
"version": "4.32.1", | ||
"description": "A pluggable minimal version of Scramjet that focuses only on stream transform and exposes only core features", | ||
@@ -59,3 +59,3 @@ "main": "lib/index.js", | ||
"dmd": "^6.0.0", | ||
"eslint": "^7.32.0", | ||
"eslint": "^8.2.0", | ||
"eslint-config-scramjet": "^3.0.0", | ||
@@ -67,8 +67,8 @@ "fancy-log": "^1.3.3", | ||
"jsdoc": "^3.6.7", | ||
"jsdoc-api": "^7.0.1", | ||
"jsdoc-api": "^7.1.0", | ||
"jsdoc-parse": "^6.0.1", | ||
"nodeunit-tape-compat": "^1.3.78", | ||
"scramjet": "^4.35.21", | ||
"tape": "^5.3.1" | ||
"scramjet": "^4.36.0", | ||
"tape": "^5.3.2" | ||
} | ||
} |
@@ -1,15 +0,20 @@ | ||
const {CLIEngine} = require("eslint"); | ||
const {ESLint} = require("eslint"); | ||
const path = require("path"); | ||
const log = require("fancy-log"); | ||
module.exports = (files = ["**/*.js"], options = {}) => (cb) => { | ||
const report = new CLIEngine({ | ||
reportUnusedDisableDirectives: 1, | ||
module.exports = (files = ["**/*.js"], options = {}) => async (cb) => { | ||
const report = await new ESLint({ | ||
reportUnusedDisableDirectives: "warn", | ||
cache: false, | ||
cwd: process.env.SCRAMJET_TEST_HOME || path.resolve(__dirname, "../../"), | ||
...options | ||
}).executeOnFiles(files); | ||
}) | ||
.lintFiles(files); | ||
for (let file of report.results) { | ||
let warningCount = 0; | ||
let errorCount = 0; | ||
for (let file of report) { | ||
if (file.errorCount || file.warningCount) { | ||
errorCount += file.errorCount; | ||
warningCount += file.warningCount; | ||
log.error(`Eslint errors in ${file.filePath}:`); | ||
@@ -24,10 +29,12 @@ file.messages.forEach( | ||
if (report.fixableErrorCount || report.fixableWarningCount) { | ||
if (report.fixableErrorCount || report.fixableWarningCount) | ||
log.info("Some eslint errors may be fixable, run `npm fix`"); | ||
} | ||
if (warningCount) | ||
log.info("Some eslint warnings were found"); | ||
if (report.errorCount || report.warningCount) | ||
if (errorCount) | ||
return cb(new Error("Lint errors or warnings found.")); | ||
cb(); | ||
}; |
239402
4772