-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Packages: Extract Eslint config package #7965
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This package is not the "default" ESLint config for WordPress, this package currently describes and uses the current Gutenberg coding standards, these coding standards do not reflect the current WordPress JavaScript coding standards and should not seek to represent that it is.
Side note: There are more instances of eslint-config-default
that need to be changed to eslint-config-gutenberg
that I did not add code comments that should also be updated.
From today's Core JS meeting, it was decided to hold off on progress here until divergences between the standards of Gutenberg and WordPress can be enumerated and reconciled. |
We should also address the following comment from @aduth #8132 (comment) as part of this PR:
|
f03b14f
to
90ab8dc
Compare
I rebased this PR with the latest
|
Next steps we agreed on today during WordPress Core JavaScript weekly chat (https://make.wordpress.org/core/2018/11/27/javascript-chat-summary-november-27-2018/):
|
51f203b
to
d5256b4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we already follow all the discussed guidelines? I'm surprised there's no change in or formatting.
It should be closely examined again, but as far as I'm aware all those changes were proposed to make coding styles used in Gutenberg to become a new standard. |
d5256b4
to
cfe0005
Compare
cfe0005
to
b1cfdc4
Compare
'./eslint/config.js', | ||
'plugin:jest/recommended' | ||
], | ||
env: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It turned out plugin:jest/recommended
includes the related env and plugins config :)
https://github.com/jest-community/eslint-plugin-jest/blob/master/index.js#L35-L52
/cc those who discussed at the last WordPress core JavaScript meeting: @aduth @afercia @herregroen @nerrad @omarreiss @youknowriad |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of inline suggested changes for ESLint spelling, otherwise 👍
Fix ESLint typo Kudos to @ntwb for catching Co-Authored-By: gziolo <grzegorz@gziolo.pl>
It might take some time until we publish the alpha version of this package. It probably all depends when WordPress RC is released. |
Description
This PR extract
Eslint
config to its own package to make it possible to publish to npm. This also helps us to get rid of a temporary hack (introduced in #5502) of havingeslint
folder in the root directory of Gutenberg.Related WordPress JavaScript core chat where we discussed coding standards which should be updated (https://make.wordpress.org/core/2018/7/25/javascript-chat-summary-july-24th/):
var
declarations should always be at the top,let
andconst
shouldn’t. This is becausevar
is hoisted, the others aren’t.How has this been tested?
npm run lint
still passes.Types of changes
Refactoring - no production code has changed.
Checklist: