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

eslint-plugin: Enforce object-shorthand #13400

Merged
merged 4 commits into from
Jan 22, 2019

Conversation

aduth
Copy link
Member

@aduth aduth commented Jan 21, 2019

This pull request seeks to propose adding object-shorthand as an enforced rule in the ESLint default configurations. This shorthand is conventionally used in most places, though by the omission of the rule, some inconsistencies have surfaced. The rule provides a "fixable" implementation, used here to correct the inconsistencies.

Pending Considerations:

This addition should be made in conjunction with a discussion in Core JS weekly chat about introduction of new rules, particularly with regard to:

  • Developing standards around ES2015+
  • Codifying where some convention had already been established

Testing instructions:

There should be no lint errors:

npm run lint-js

@aduth aduth added the [Tool] ESLint plugin /packages/eslint-plugin label Jan 21, 2019
Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

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

Love this change 💯

All changes look great.

@gziolo gziolo added the [Type] Code Quality Issues or PRs that relate to code quality label Jan 22, 2019
@gziolo gziolo added this to the 5.0 (Gutenberg) milestone Jan 22, 2019
@aduth aduth merged commit af9ea75 into master Jan 22, 2019
@aduth aduth deleted the add/eslint-config-object-shorthand branch January 22, 2019 17:28
@aduth
Copy link
Member Author

aduth commented Jan 22, 2019

Discussed in #core-js weekly meeting (link requires registration)

https://wordpress.slack.com/archives/C5UNMSU4R/p1548167064197400

Per discussion, I updated the coding-guidelines.md document, both to sync with the current JavaScript standards and to make mention of this style convention.

youknowriad pushed a commit that referenced this pull request Mar 6, 2019
* Packages: Use object shorthand notation when possible

* eslint-plugin: Enforce object-shorthand

* Docs: Remove coding guidelines merged upstream to WP standard

* Docs: Add object shorthand style to coding guidelines
youknowriad pushed a commit that referenced this pull request Mar 6, 2019
* Packages: Use object shorthand notation when possible

* eslint-plugin: Enforce object-shorthand

* Docs: Remove coding guidelines merged upstream to WP standard

* Docs: Add object shorthand style to coding guidelines
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Tool] ESLint plugin /packages/eslint-plugin [Type] Code Quality Issues or PRs that relate to code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants