Skip to content

Commit

Permalink
all linter pkgs updated
Browse files Browse the repository at this point in the history
  • Loading branch information
izelnakri committed Mar 5, 2022
1 parent 9fd4e59 commit d23c93f
Show file tree
Hide file tree
Showing 5 changed files with 555 additions and 532 deletions.
2 changes: 1 addition & 1 deletion lib/runners/application-files-watcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export default async function(
(path, event) => reloadApplicationWithMessage(path, event, distPath)
),
eslintRC: watch(`${projectRoot}/.eslintrc.js`, async () => {
buildConfig.jsLinter = new eslint.CLIEngine(await import(`${projectRoot}/.eslintrc.js`));
buildConfig.jsLinter = new eslint.ESLint(await import(`${projectRoot}/.eslintrc.js`));
})
});

Expand Down
18 changes: 10 additions & 8 deletions lib/utils/lint-javascript.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import eslintReporter from 'eslint/lib/cli-engine/formatters/codeframe.js';
import eslintReporter from 'eslint-formatter-codeframe';

export default function(files, jsLinter) {
const report = jsLinter.executeOnFiles(files);
const result = eslintReporter(report.results);
export default async function(files, jsLinter) {
const report = await jsLinter.lintFiles(files);

if (result) {
console.log(result);
}
if (report.length > 0) {
let result = eslintReporter(report);
if (result) {
console.log(result);
}

return result;
return result;
}
}
4 changes: 2 additions & 2 deletions lib/worker-pool/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ parentPort.on(
} else if (action === 'LINT_JS') {
Console.log(workerReference, chalk.yellow('linting JS/TS'));

global.jsLinter = global.jsLinter || new eslint.CLIEngine();
global.jsLinter = global.jsLinter || new eslint.ESLint();

try {
const timer = countTime();

lintJavaScript(fileNames, global.jsLinter);
await lintJavaScript(fileNames, global.jsLinter);

Console.log(
workerReference,
Expand Down
Loading

0 comments on commit d23c93f

Please sign in to comment.