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

[question] Why are semicolons reported as errors? #729

Closed
joshyrobot opened this issue Dec 23, 2016 · 3 comments

Comments

@joshyrobot
Copy link

commented Dec 23, 2016

I was recently writing an AVA test to check my formatting, and I noticed that extra semicolons are considered errors instead of warnings. Semicolons aren't needed, but they wont break your code either, so shouldn't it be a warning?
semicolon
error

@Flet

This comment has been minimized.

Copy link
Member

commented Dec 24, 2016

This is a bit of a loaded question! :)

Some rules in standard are for catching commit errors and others are stylistic choices that help make code clear and consistent. All rules in standard are reported as errors for simplicity.

Regarding semicolons, there is some great material and references here: http://standardjs.com/rules.html#semicolons

From standardjs.com:

At the end of the day you have to 'just pick something', and that's the whole philosophy of standard -- its a bunch of sensible 'just pick something' opinions.

  • For folks who prefer semicolons, semistandard is a good choice.
  • Some folks will even use eslint-config-standard directly with eslint and override/change rules as they see fit.

I hope this information helps!

@Flet Flet closed this Dec 24, 2016

@joshyrobot

This comment has been minimized.

Copy link
Author

commented Dec 24, 2016

Ok, so I should just ignore the warningCount because it will always be reported as an error? And also, I have no problem with removing semicolons! :)

@feross

This comment has been minimized.

Copy link
Member

commented Dec 24, 2016

You can safely ignore warningCount. It will always be zero when using standard or eslint-config-standard.

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
3 participants
You can’t perform that action at this time.