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

Should lintOnSave be renamed? #817

Closed
chrisvfritz opened this issue Feb 9, 2018 · 6 comments
Closed

Should lintOnSave be renamed? #817

chrisvfritz opened this issue Feb 9, 2018 · 6 comments

Comments

@chrisvfritz
Copy link
Contributor

I actually do want lint on save, which I have configured through my editor, but I choose to keep the lintOnSave option in vue.config.js disabled because it does more than that - it halts compilation on any linting errors (even if it's a minor stylistic issue). I've seen this behavior frustrate some as they didn't expect it, so perhaps we should rename the option to better match what it actually does. haltCompilationOnLintingErrors might be a little unwieldly, but I'm open to other ideas.

Another option might be to always run the linter, but only if compilation fails due to a syntax error. I don't know if eslint-loader actually allows that or if it can be done some other way, but I think that's more helpful behavior that people are probably less likely to want to disable.

@LinusBorg
Copy link
Member

it halts compilation on any linting errors. [...] I've seen this behavior frustrate some as they didn't expect it

I think this feature would more acurately be named lintOnCompile. Had similar feedback for the webpack template about it being disruptive.

Another option might be to always run the linter, but only if compilation fails due to a syntax error.

Not too long ago I changed the eslint-loader settings in the webpack template to only emit warning, and webpack to only fail on errors (to accomodate those finding the original behavior disruptive).

Since syntax errors are catched by babel as well, this allows people to see errors in the console while the compilation does finish as expected and the workflow isn't disrupted.

@chrisvfritz chrisvfritz changed the title Should lintOnSave actually be renamed to something more accurate? Should lintOnSave be renamed? Feb 9, 2018
@chrisvfritz
Copy link
Contributor Author

chrisvfritz commented Feb 9, 2018

@LinusBorg What has feedback been since making that change? If we can give people useful warnings in the terminal without interrupting their workflow if they don't want to look at them, then we might not even need an option to disable lint-on-compile. Thoughts?

@LinusBorg
Copy link
Member

Well I have no received any complaints since we neither stop compiling nor show linting errors in the overlay, but can't say more than that one way or another.

Yet I would still feel we need some way to disable eslint-loader altogether because not everyone wants to lint during compilation, even if the results "only" clutter up their console. I added that as an option to the webpack template as well with those other changes.

@yyx990803
Copy link
Member

yyx990803 commented Feb 9, 2018

What about allowing lintOnSave to take values such as 'error' and 'warning'? With lint errors being emitted as warnings it won't halt compilation.

@chrisvfritz
Copy link
Contributor Author

@yyx990803 I like it! 😄

@LinusBorg
Copy link
Member

Agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants