Skip to content

Adds prettier plugin to eslint - #40118

Merged
scinos merged 1 commit into
masterfrom
add/eslint-prettier-integration
Apr 6, 2020
Merged

scinos merged 1 commit into
masterfrom
add/eslint-prettier-integration

Conversation

@scinos

@scinos scinos commented Mar 13, 2020 •

Copy link
Copy Markdown
Contributor

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 March 13, 2020 10:55
@matticbot

Copy link
Copy Markdown
Contributor

@matticbot

Copy link
Copy Markdown
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
Comment thread .eslintrc.js
'plugin:jsx-a11y/recommended',
'plugin:jest/recommended',
'prettier',
'plugin:prettier/recommended',

Copy link
Copy Markdown
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.

@scinos scinos mentioned this pull request Apr 6, 2020
5 of 6 tasks

@lynnbgriffith lynnbgriffith left a comment

Copy link
Copy Markdown
Contributor

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