Skip to content

No error thrown for index signature with declare modifier #12109

@sosukesuzuki

Description

@sosukesuzuki

Bug Report

  • I would like to work on a fix!

Current behavior

No syntax error is thrown.

REPL

Input Code

class C {
  declare [key: string]: string;
}

Expected behavior

The parser should throw a syntax error 'declare' modifier cannot appear on an index signature.. Like TypeScript.

Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)

parse(code, { plugins: ["typescript"] });

Environment

Possible Solution

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: typescriptoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issuepkg: parser

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions