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

eslint --quiet --fix fixes warnings #8353

Closed
alberto opened this issue Mar 29, 2017 · 4 comments
Closed

eslint --quiet --fix fixes warnings #8353

alberto opened this issue Mar 29, 2017 · 4 comments
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly 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

Comments

@alberto
Copy link
Member

alberto commented Mar 29, 2017

Tell us about your environment

  • ESLint Version: master
  • Node Version: v6.10.0
  • npm Version: 3.10.10

What parser (default, Babel-ESLint, etc.) are you using?
default

Please show your full configuration:

{
  "globals": {},
  "env": {},
  "rules": {
    "quotes": "warn",
    "semi": "error",
    "no-unused-vars": "error"
  },
  "parserOptions": {},
  "root": true
}

What did you do? Please include the actual source code causing the issue.

var foo = 'foo'

This produces the following errors running: eslint foo.js

  1:5   error    'foo' is assigned a value but never used  no-unused-vars
  1:11  warning  Strings must use doublequote              quotes
  1:16  error    Missing semicolon                         semi

Running eslint --quiet only outputs errors, as expected:

  1:5   error  'foo' is assigned a value but never used  no-unused-vars
  1:16  error  Missing semicolon                         semi

What did you expect to happen?
Running eslint foo.js --quiet --fix would only report and fix errors

What actually happened? Please include the actual, raw output from ESLint.
eslint also fixed the warning on "quotes"

var foo = "foo";
@eslintbot eslintbot added the triage An ESLint team member will look at this issue soon label Mar 29, 2017
@alberto alberto changed the title eslint --quiet --fix fixes warning eslint --quiet --fix fixes warnings Mar 29, 2017
@alberto alberto added bug ESLint is working incorrectly 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 and removed triage An ESLint team member will look at this issue soon labels Mar 30, 2017
@Slayer95
Copy link

I disagree with the notion of this being a bug.
--quiet is interpreted as a logging modifier flag, kind of the opposite of --verbose, and it therefore shouldn't suppress the side effects of --fix.

@gyandeeps
Copy link
Member

gyandeeps commented May 22, 2017

I think it makes sense what @Slayer95 said above. quite is a log level modifier and not a operation level modifier. With that being said, its working as expected.
@eslint/eslint-team thoughts?

If we dont need any change on this then we can close this issue.

@platinumazure
Copy link
Member

I can see it both ways. The fact that the behavior can be seen as extremely unexpected and/or damaging to the user is definitely a bad thing, in my mind.

I think the best way to fix this is to allow users the option to go either way and to be very explicit about how the options work.

Here's one proposal along those lines:

  • Rename --quiet to --no-report-warnings (supporting --quiet as an alias and preserving its behavior), to avoid reporting warnings but possibly fix them
  • Add option --no-fix-warnings to support not running autofix on warnings but possibly report them
  • Users can use both to completely ignore warnings altogether

The first point above isn't critical for the situation alberto described, but it does allow ESLint CLI to be much more intuitive to users.

@alberto
Copy link
Member Author

alberto commented Jun 1, 2017

Thanks for your interest in improving eslint. Unfortunately, it looks like this issue didn't get enough support from the team and so I'm closing it. While we wish we'd be able to accommodate everyone's requests, we do need to prioritize. We've found that issues failing to reach consensus after 21 days tend to never do it, and as such, we close those issues. This doesn't mean the idea isn't interesting, just that it's not something the team can commit to.

@alberto alberto closed this as completed Jun 1, 2017
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 6, 2018
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 bug ESLint is working incorrectly 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
Projects
None yet
Development

No branches or pull requests

5 participants