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

Add Prettier to ESLint configuration. #1206

Merged
merged 2 commits into from
May 13, 2020
Merged

Add Prettier to ESLint configuration. #1206

merged 2 commits into from
May 13, 2020

Conversation

rwjblue
Copy link
Member

@rwjblue rwjblue commented May 12, 2020

Prior to this change, we had a .prettierrc.js in the repo that some
contributors used with their editors' "format on save" ability, but
since it was not enforced by linting it was very inconsistent throughout
the codebase.

This change does a few things (best reviewed as separate commits):

  • Update eslint to v7.0.0
  • Add prettier related packages to devDependencies
  • Configure prettier setup in .eslintrc.js
  • Run yarn lint:js --fix

@@ -62,13 +64,12 @@ module.exports = {
node: true
},
plugins: ['node'],
rules: Object.assign({}, require('eslint-plugin-node').configs.recommended.rules, {
Copy link
Member Author

Choose a reason for hiding this comment

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

ESLint 6.8+ allows us to use extends directly in the overrides configuration, so we no longer need this manual shenanigans.

Copy link
Member

@RobbieTheWagner RobbieTheWagner left a comment

Choose a reason for hiding this comment

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

@rwjblue I tend to turn off trailing commas myself. What do other Ember repos tend to do?

@rwjblue
Copy link
Member Author

rwjblue commented May 12, 2020

I usually try to go with the defaults as much as possible (with single quotes being the one exception). Ember, Ember Data, Ember CLI, ember-test-helpers all have trailing commas on (set to es5).

Also, FWIW, in this PR I didn't actually change/modify the prettier configuration (it was introduced in #1112 / #1093).

@RobbieTheWagner
Copy link
Member

@rwjblue yeah, trailing commas wasn't on by default until prettier 2.0 though. Now that it is on by default, I typically disable. I am fine going with what the group wants though, not going to die on this hill.

rwjblue added 2 commits May 13, 2020 09:52
This will help ensure prettier formatting is properly enforced
throughout the codebase, and that colloborators' that have "format on
save" don't clash with each other by using varying versions of prettier.
@rwjblue rwjblue merged commit 7f51cab into master May 13, 2020
@rwjblue rwjblue deleted the update-eslint branch May 13, 2020 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants