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

Code style #262

Closed
dmitmel opened this issue Mar 27, 2018 · 6 comments
Closed

Code style #262

dmitmel opened this issue Mar 27, 2018 · 6 comments

Comments

@dmitmel
Copy link
Contributor

dmitmel commented Mar 27, 2018

While refactoring code, I noticed that the codebase contains different coding styles because many people contribute to this project. This causes some problems like inconsistent line length.

My suggestions are:

  • Use Prettier instead of Standard, because Prettier produces more consistent code. However, Prettier doesn't follow the JavaScript Standard Style, e.g. it doesn't put a space after function name in declarations.
  • Use ESLint with something like the Airbnb preset.
@andywer
Copy link
Owner

andywer commented Mar 27, 2018

Could you please link to those places with different code styles?

Using prettier has been a topic for quite some time. I don't see any reason against, there was just no time yet to do that.

How would the Airbnb ruleset change anything? Because it's stricter?

@dmitmel
Copy link
Contributor Author

dmitmel commented Mar 27, 2018

@andywer

Using prettier has been a topic for quite some time. I don't see any reason against, there was just no time yet to do that.

Setting up Prettier and ESLint is really easy, I've even created an ESLint preset that automatically configures Prettier and the Airbnb preset.

How would the Airbnb ruleset change anything? Because it's stricter?

No. It's just my preference.

@farism
Copy link

farism commented Apr 23, 2018

I prefer husky + prettier and no eslint. I understand that eslint handles a whole class of things that prettier does not, but I kind of like to talk about those things during code review anyway.

@andywer
Copy link
Owner

andywer commented Apr 24, 2018

I understand that eslint handles a whole class of things that prettier does not, but I kind of like to talk about those things during code review anyway.

That is true for code style, but the important "whole class of things that prettier does not handle" is stuff like checking for unused variables, broken references, etc. That's what prettier cannot provide. I say it should not be the reviewer's responsibility either, since it can be reliably checked by software 😉

@andywer
Copy link
Owner

andywer commented Jun 8, 2018

Is this issue still relevant, now that we have prettier in the v2.0 branch?

@vlad-zhukov
Copy link
Collaborator

We've got both Prettier and ESLint. Now we can add more ESLint rules over time.

@dmitmel dmitmel closed this as completed Apr 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants