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

Commit

Permalink
fix: Updates Eslint process to run with project directory (#73)
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 3, 2022
1 parent 524fd6a commit ad55434
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/plugin-runner-eslint/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,16 @@ enum SeverityLevel {
export default defineRunner(
defineOptionsFromJSONSchema<EslintRunnerOptions>(require('./schema.json')),
async function(ctx) {
const { logger, options, input, workspace } = ctx;
const { logger, options, input, workspace, project } = ctx;
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 Down

0 comments on commit ad55434

Please sign in to comment.