Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upRequire Object Literal Shorthand Syntax (object-shorthand) #1354
Comments
feross
added
the
enhancement
label
Aug 12, 2019
This comment has been minimized.
This comment has been minimized.
|
I'd love this. avoidQuotes
{ 'foo-bar'() {} }ignoreConstructorsWhy is this a thing, please? I don't understand how in the example the rule can figure out that it's a constructor. It determines according to the name of the function, And, again, why bother making it an exception at all? avoidExplicitReturnArrowsI kinda like it. Yes... I'd say |
feross commentedAug 12, 2019
•
edited
Thoughts on enabling this rule? https://eslint.org/docs/rules/object-shorthand
ECMAScript 6 provides a concise form for defining object literal methods and properties. This syntax can make defining complex object literals much cleaner.
Here are a few common examples using the ES5 syntax:
Now here are ES6 equivalents:
Related to: #159