Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

do not call the fix functions in no-autofix mode #14637

Closed
aladdin-add opened this issue May 27, 2021 · 5 comments
Closed

do not call the fix functions in no-autofix mode #14637

aladdin-add opened this issue May 27, 2021 · 5 comments
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion breaking This change is backwards-incompatible core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion
Projects

Comments

@aladdin-add
Copy link
Member

aladdin-add commented May 27, 2021

The version of ESLint you are using.
latest

The problem you want to solve.

eslint will always call the fix functions even in no-autofix mode.

Your take on the correct solution to problem.

do not call the fix functions in no-autofix mode. Pros:

@aladdin-add aladdin-add added enhancement This change enhances an existing feature of ESLint core Relates to ESLint's core APIs and features evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels May 27, 2021
@eslint-github-bot eslint-github-bot bot added this to Needs Triage in Triage May 27, 2021
@aladdin-add aladdin-add moved this from Needs Triage to Ready for Dev Team in Triage May 27, 2021
aladdin-add added a commit to aladdin-add/eslint that referenced this issue May 27, 2021
@mdjermanovic
Copy link
Member

Running ESLint in no-autofix mode doesn't necessarily mean that fixes are not needed. Autofix mode (--fix) is more like "automatically apply fixes". Integrations can use LintMessage#fix property to manually apply fixes (vscode-eslint example). I think that without an additional flag we can't really know whether or not the fix property will be used.

@aladdin-add
Copy link
Member Author

good point! but at the very least, it can be skipped in eslint cli. :)

@mdjermanovic
Copy link
Member

but at the very least, it can be skipped in eslint cli. :)

Integrations/scripts can run ESLint through cli (ale example) and then use the output from a formatter, so we can't be sure that fix isn't needed (e.g., json formatter prints fix). I think this would be likely a breaking change, and that we'd also need to add a cli flag that could restore the previous behavior.

@aladdin-add aladdin-add added the breaking This change is backwards-incompatible label May 27, 2021
@nzakas nzakas moved this from Ready for Dev Team to Feedback Needed in Triage May 29, 2021
@nzakas
Copy link
Member

nzakas commented May 29, 2021

I’m not sure this is worth changing without quantifying what kind of performance change we might get.

@aladdin-add if you’re interested in pursuing this, I’d suggest creating a perf test that shows the difference between what we have now and what you’re suggesting. I’m guessing the actual change is probably pretty small.

@nzakas
Copy link
Member

nzakas commented Aug 21, 2021

Closing because we couldn’t reach consensus on moving forward here.

@nzakas nzakas closed this as completed Aug 21, 2021
Triage automation moved this from Feedback Needed to Complete Aug 21, 2021
@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Feb 18, 2022
@eslint-github-bot eslint-github-bot bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion breaking This change is backwards-incompatible core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion
Projects
Archived in project
Triage
Complete
Development

No branches or pull requests

3 participants