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

Adds prettier plugin to eslint #40118

Merged
merged 1 commit into from
Apr 6, 2020
Merged

Conversation

scinos
Copy link
Contributor

@scinos scinos commented Mar 13, 2020

Changes proposed in this Pull Request

Kapture 2020-03-13 at 11 47 03

Testing instructions

  • Configure your editor to highlight eslint errors and auto-fix them on save.
  • Checkout the branch, open any .js file and type anything with formatting errors (eg: extra spaces)
  • Check your editor highlights them, and fixes them on save.

@scinos scinos requested a review from a team as a code owner March 13, 2020 10:55
@matticbot
Copy link
Contributor

@matticbot
Copy link
Contributor

This PR does not affect the size of JS and CSS bundles shipped to the user's browser.

Generated by performance advisor bot at iscalypsofastyet.com.

@scinos scinos self-assigned this Mar 13, 2020
@scinos scinos added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Mar 13, 2020
@@ -7,7 +7,7 @@ module.exports = {
'wpcalypso/react',
'plugin:jsx-a11y/recommended',
'plugin:jest/recommended',
'prettier',
'plugin:prettier/recommended',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using the recommended config from https://prettier.io/docs/en/integrating-with-linters.html#recommended-configuration

This does three things:

  • Extends "prettier" (as before)
  • Add plugin "prettier" that allow running prettier as an eslint rule
  • Configure prettier rules to use "error" level.

Copy link
Contributor

@griffbrad griffbrad left a comment

Choose a reason for hiding this comment

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

🚢LGTM

Note for other VSCode users: the eslint extension docs explain how you'll configure codeActionsOnSave:
https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint
Typically, in settings.json, you'll just add:
"editor.codeActionsOnSave": { "source.fixAll": true }

@scinos scinos merged commit 2e89b01 into master Apr 6, 2020
@scinos scinos deleted the add/eslint-prettier-integration branch April 6, 2020 13:07
@matticbot matticbot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Apr 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants