question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow output when fixes are automatically applied

See original GitHub issue

Observed 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:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:39 (39 by maintainers)

github_iconTop GitHub Comments

3reactions
ilyavolodincommented, Mar 22, 2017

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.

2reactions
not-an-aardvarkcommented, Oct 19, 2016

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:

/* eslint quote-props: [error, "always"], quotes: [error, "single"] */

({ foo: 1 })

First, the quote-props fixer is applied:

({ "foo": 1 })

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:

({ 'foo': 1 })

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-propsandquotes fixed 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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found