Skip to content
This repository was archived by the owner on Jan 14, 2019. It is now read-only.
This repository was archived by the owner on Jan 14, 2019. It is now read-only.

cannot distinguish declare global on AST. #27

Closed
@mysticatea

Description

@mysticatea

What version of TypeScript are you using?

  • 3.1.6

What version of typescript-estree are you using?

  • 2.1.0 (typescript-eslint-parser#master)

What code were you trying to parse?

// Augmentations for the global stuff.
declare global {
}

// A namespace declaration.
declare namespace global {
}

What did you expect to happen?

typescript-estree generates different nodes because the two have different semantics.

What actually happened?

typescript-estree generates the same node:

    {
      "type": "TSModuleDeclaration",
      "id": {
        "type": "Identifier",
        "name": "global"
      },
      "body": {
        "type": "TSModuleBlock",
        "body": []
      },
      "declare": true
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions