Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Commit

Permalink
fix: Resolve bug on eslint when linting multi projects (#80)
Browse files Browse the repository at this point in the history
Co-authored-by: jose.rosa <[email protected]>
  • Loading branch information
joserosa33 and joserosa333 authored Jan 14, 2022
1 parent f431f31 commit bba318b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/plugin-runner-eslint/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,6 @@ export default defineRunner(
const { configFile, outputDir, fix: fixFlag } = options;
const fix = Boolean(outputDir) && fixFlag;

/*
* Updates the cwd to be the project
* In this way the TS parser will only parse the project files
*/
process.chdir(project.fullPath);

logger.info(`Linting files with ESLint`);

const cliEngineOpts: CLIEngine.Options = { fix, cwd: workspace.cwd };
Expand All @@ -58,6 +52,12 @@ export default defineRunner(
const cli = new CLIEngine(cliEngineOpts);

ctx.input(files => {
/*
* Updates the cwd to be the project
* In this way the TS parser will only parse the project files
*/
process.chdir(project.fullPath);

const fixes: File[] = [];

files.forEach(file => {
Expand Down

0 comments on commit bba318b

Please sign in to comment.