-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Update is-shallow-equal to use ES5 code as before #8132
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.
Looks good (aside from the linting issue with package.json). I copied the changes into the @wordpress/is-shallow-equal
package in my dummy app importing it and there's no build errors now.
"files": [ | ||
"arrays.js", | ||
"objects.js" | ||
], |
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.
package.json linting failed with this:
./packages/is-shallow-equal/package.json
[0] ✖ prefer-property-order - node: - Your package.json properties are not in the desired order. Please move "main" after "files".
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.
Ha, correct. Our linter is very strict 😄
@@ -0,0 +1,5 @@ | |||
{ |
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.
Note for future reference in extracting rules: We should consider having separate rulesets for ES5 vs. ES2015+ .
Looks like this is already built-in to eslint-plugin-wordpress
:
https://github.com/WordPress-Coding-Standards/eslint-plugin-wordpress#available-rulesets
(Confused why there's both a config and a plugin which includes rulesets)
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.
Agreed, it would be much easier to put the following:
{
"root": true,
"extends": "something"
}
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.
Yeah, I do this in my own projects, where (like with this one) I sometimes intentionally author in ES5.
https://github.com/aduth/memize/blob/4c0c9f9/.eslintrc.json#L3
https://github.com/aduth/equivalent-key-map/blob/e80140c/.eslintrc.json#L3
Description
Closes #8048.
Fixes an issue raised by @nerrad in #8048:
I followed recommendation from @aduth:
and reverted the change I introduce when merging this package into Gutenber repository in #7556.
How has this been tested?
npm test
passesnpm run dev
andnpm run build
work as beforeChecklist: