Skip to content

Misplaced annotation warning with computed properties in ES6 classes #1126

Closed
@ochafik

Description

@ochafik
let bar = 'bar';
class Foo {
  /** @return {boolean} */
  get [bar]() { return true; }

  /** @return {boolean} */
  ['baz']() { return true; }
}

Both members get a:
WARNING - Misplaced function annotation. This JSDoc is not attached to a function node. Are you missing parentheses?

(run with --language_in=ECMASCRIPT6_STRICT -O SIMPLE)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions