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

format code with Prettier #3344

Merged
merged 2 commits into from
Apr 22, 2018
Merged

format code with Prettier #3344

merged 2 commits into from
Apr 22, 2018

Conversation

boneskull
Copy link
Contributor

This adds Prettier w/ ESLint integration. Formatting is managed via prettier-eslint-cli which formats with Prettier then applies ESLint fixes thereafter.

The only noticeable conflict with our semistandard-based ESLint config is the lack of a space after the function keyword; this particular rule is suppressed by eslint-plugin-prettier and its ilk.

The motivations here:

  1. Consistency
  2. Automation
  3. Avoid debate about code style

lint-staged and husky are here to automatically format staged JS files as a pre-commit hook. I personally use this setup in other places and it hasn't caused any friction.

@boneskull boneskull added the type: chore generally involving deps, tooling, configuration, etc. label Apr 22, 2018
@coveralls
Copy link

Coverage Status

Coverage remained the same at 90.009% when pulling 5759baf on prettier into efff26f on master.

Copy link
Contributor

@Bamieh Bamieh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a huge +1 on this. I personally prefer the functions to be written like this.

Copy link
Contributor

@outsideris outsideris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automation is always good!

@Munter
Copy link
Contributor

Munter commented Apr 22, 2018

Awesome!

@boneskull boneskull merged commit 5fc5845 into master Apr 22, 2018
@boneskull boneskull deleted the prettier branch April 22, 2018 19:18
@bakkot bakkot mentioned this pull request May 12, 2018
@boneskull boneskull added this to the next milestone May 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: chore generally involving deps, tooling, configuration, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants