Skip to content

Bug: no-useless-key doesn't report on TemplateLiterals #19280

Closed as not planned
Closed as not planned
@abrahamguo

Description

Environment

Environment Info:

Node version: v22.12.0
npm version: v11.0.0
Local ESLint version: v9.17.0 (Currently used)
Global ESLint version: Not found
Operating System: darwin 24.1.0

What parser are you using?

Default (Espree)

What did you do?

Configuration
/* eslint no-useless-computed-key: "error" */
const foo = { [`a`]: 1 };

What did you expect to happen?

The useless computed key should be reported.

What actually happened?

It was not reported.

Link to Minimal Reproducible Example

https://eslint.org/play/#eyJ0ZXh0IjoiLyogZXNsaW50IG5vLXVzZWxlc3MtY29tcHV0ZWQta2V5OiBcImVycm9yXCIgKi9cbmNvbnN0IGZvbyA9IHsgW2BhYF06IDEgfTsiLCJvcHRpb25zIjp7InJ1bGVzIjp7fSwibGFuZ3VhZ2VPcHRpb25zIjp7InBhcnNlck9wdGlvbnMiOnsiZWNtYUZlYXR1cmVzIjp7fX19fX0=

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

No response

Activity

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

Metadata

Assignees

No one assigned

    Labels

    works as intendedThe behavior described in this issue is working correctly

    Type

    No type

    Projects

    • Status

      Complete

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions