Skip to content

Support --fix-dry-run option in programmatic API #15877

Discussion options

You must be logged in to vote

Can you elaborate more on what would be the functionality of this flag in ESLint API?

Linting and saving the changes are already two separate steps:

eslint/lib/cli.js

Lines 295 to 307 in ee69cd3

if (useStdin) {
results = await engine.lintText(text, {
filePath: options.stdinFilename,
warnIgnored: true
});
} else {
results = await engine.lintFiles(files);
}
if (options.fix) {
debug("Fix mode enabled - applying fixes");
await ESLint.outputFixes(results);
}

If you want to get the fixed versions (with…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jopemachine
Comment options

Answer selected by jopemachine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants