Allow output when fixes are automatically applied
See original GitHub issueObserved in eslint 3.8.1
Right now if you run with --fix
and eslint only finds fixable issues, it will output nothing and exit with code 0.
However, it may have caused changes to your files on disk. Developers might not notice this. We’ve found some problems where developers will run eslint
and then push to Github, without catching that changes have been applied locally.
Is it currently possible to output messages for fixes that have been automatically applied? Or some other way of differentiating between “everything is good” vs. “there were errors but they were fixed”. I’m happy to put together a PR for this if this functionality does not exist.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:39 (39 by maintainers)
Top Results From Across the Web
Rule tester output not applying all fixes · Issue #11187 - GitHub
I think we can keep fixing one report by default, but we can provide an option (maybe called applyAllFixes ) to allow plugin...
Read more >Verify if the hotfix for CVE-2022-1040 is applied
Go to Backup & firmware > Firmware > Hotfix. Turn on Allow automatic installation of hotfixes. Click Apply. 43853.jpg. Note: Once turned on, ......
Read more >Create output port for subsystem or external output - Simulink
The Outport block automatically unifies the bus to a vector having the same number of elements as the bus, and provides that vector...
Read more >Get results and fix problems | PyCharm Documentation
This allows you to batch-apply quick-fixes to the selected scope without examining each problem individually. During the cleanup, the IDE ...
Read more >Fix sound or audio problems in Windows - Microsoft Support
Select your device and then select Properties. Next to Device usage, check that Use this device (enable) is selected from the list for...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I honestly think that this issue should be moved out of 4.0 and into the next milestone. It doesn’t have an implementation yet, and it doesn’t even look like we are settled on a way to do this. I would rather not rush a solution just to get it into a release. There’s nothing stopping us from doing another major release in a month or two.
This seems like a reasonable change. However, in terms of reporting the actual number of fixes, I’m worried about overestimating the number of fixed problems due to the way multi-pass autofixing works.
For example, here’s some code:
First, the
quote-props
fixer is applied:Then ESLint is run again on the resulting code, to ensure fix any other linting errors that might have been output. In this case, a new error with
quotes
has been created, so another fix will be applied:Then ESLint is run again on the resulting code. No errors are reported, so the process exits.
In this scenario, how many fixes were applied? Technically, 2 fixes were applied, but it might be confusing if we output something like
2 problems fixed
, or ``quote-propsand
quotesfixed problems
, because the original code only had one problem. The second fix was only necessary as a result of the first fix.I still think this change is doable, but if the message is going to be anything more detailed than
some things were fixed
, we should think about how we can convey that without confusion.