Skip to content

AST tightening: TSExternalModuleReference#expression must be a StringLiteral #9220

@Josh-Cena

Description

@Josh-Cena

Suggestion

In #9211: we are planning to enforce the following invariants in our AST for TSExternalModuleReference (used in TSImportEqualsDeclaration):

  • expression must be a string literal, so the following is a parsing error:
    import x = require(1);
    import x = require(1 + 1);

@sosukesuzuki @fisker Do these look safe to you?

Metadata

Metadata

Assignees

No one assigned

    Labels

    ASTPRs and Issues about the AST structureenhancementNew feature or requestlocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.package: typescript-estreeIssues related to @typescript-eslint/typescript-estree

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions