Skip to content

Expected property shorthand warning on computed property #6015

Description

@kikoanis

What version of ESLint are you using?
2.9.0

What parser (default, Babel-ESLint, etc.) are you using?
babel-eslint = 6.0.4

Please show your full configuration:

rules: {
   ...
   "object-shorthand": 1,
   ...
}

What did you do? Please include the actual source code causing the issue.

const constant = 'foo'
....
const obj = { [constant]: constant }

What did you expect to happen?
This should pass or I am missing something on how to do it.
What actually happened? Please include the actual, raw output from ESLint.
warning Expected property shorthand object-shorthand

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionbugESLint is working incorrectlyruleRelates to ESLint's core rules

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions