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

Projects
None yet
2 participants
@aduth
Copy link
Member

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
@gziolo

gziolo approved these changes Jan 22, 2019

Copy link
Member

gziolo left a comment

Love this change 💯

All changes look great.

@gziolo gziolo added this to the 5.0 (Gutenberg) milestone Jan 22, 2019

@aduth aduth merged commit af9ea75 into master Jan 22, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@aduth aduth deleted the add/eslint-config-object-shorthand branch Jan 22, 2019

@aduth

This comment has been minimized.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment