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

Semicolons and using 'standard' with React/client-side Javascript #698

Closed
karloespiritu opened this issue Nov 23, 2016 · 4 comments

Comments

@karloespiritu
Copy link

commented Nov 23, 2016

I'm using standard for all of my new Node.js projects, and it works great so far. I'm wondering if standard would also be ideal for React projects. I really like using standard as my linter because I prefer my JS code without the semicolons.

Based on the standardjs docs, the only gotcha with omitting semicolons is when starting a line with (, [, or `. And then, I came across this discussion - https://forum.shakacode.com/t/es6-airbnb-style-guidelines-and-semicolons/235

It was mentioned by someone from AirBnb that these three characters are NOT the only gotchas, but also -- arithmetic operators and template literals.

I also noticed that most React-based projects, including Facebook's create-react-app project still use semicolons. Most of the boilerplate projects for React use Airbnb's JS style guide, which requires using semicolons and dangling commas.

My question is -- Will there be any issues if I use standard as a style guide for React or any client-side Javascript code that is transpiled to ES5?

It would be really nice to use standard for React/client-side javascript projects so I can unify my JS code style guide for both Node.js and React. Thanks.

@karloespiritu karloespiritu changed the title Semicolons and using `standard` with React/client-side Javascript Semicolons and using 'standard' with React/client-side Javascript Nov 23, 2016

@dcousens

This comment has been minimized.

Copy link
Member

commented Nov 23, 2016

Will there be any issues if I use standard as a style guide for React or any client-side Javascript code that is transpiled to ES5?

Nope 👍

standard will warn you about any of the crazy gotchas thanks to eslint.

@Guria

This comment has been minimized.

Copy link

commented Nov 23, 2016

@karloespiritu just try this on cases on demo. Both arithmetic operators and template literals emit warnings.

@karloespiritu

This comment has been minimized.

Copy link
Author

commented Nov 23, 2016

Awesome thank you very much @dcousens @Guria for the confirmation. 👍 I'll proceed with my plans to use also standard for my React projects. I will finally have a unified code style guide for Node.js and React. 🍻

@LinusU

This comment has been minimized.

Copy link
Member

commented Nov 23, 2016

Glad to hear it 🙌

@LinusU LinusU closed this Nov 23, 2016

@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.
4 participants
You can’t perform that action at this time.