Skip to content

access exported interface from import * as  #589

@sophister

Description

@sophister

What code were you trying to parse?

// in file common.ts
export interface User {
  name: string;
  age: number;
};

export interface Profile {
  addr: string;
  city: string;
};

export enum Status {
  OK,
  Fail
};

// in another file  foo.ts
import * as all from './common.ts';
all.User;      // does not exist
all.Profile;   //does not exist
all.Status;  //OK

What did you expect to happen?
I can access interface with all.User and all.Profile
What actually happened?
import * as lost exported interface
Versions

package version
@typescript-eslint/parser 1.7.0
TypeScript 3.4.3
ESLint 5.16.0
node 10.14.1
npm 6.4.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    package: parserIssues related to @typescript-eslint/parsertriageWaiting for team members to take a look

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions