Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Named Import Specifier is missing isTypeOnly in structure #1345

Closed
matt-kinton opened this issue Oct 24, 2022 · 0 comments · Fixed by #1347
Closed

Named Import Specifier is missing isTypeOnly in structure #1345

matt-kinton opened this issue Oct 24, 2022 · 0 comments · Fixed by #1347
Labels

Comments

@matt-kinton
Copy link

When using ImportSpecifierStructure the structure doesn't contain the isTypeOnlyFlag, this prevents you from creating Type Only Named Imports.

The same issue is also contained in the addImportDeclaration function. You can add Named Imports, but not type only ones.

Version: 16.0.0

To Reproduce

import { Project } from "ts-morph";

const project = new Project();
const sourceFile = project.createSourceFile("test.ts", ``);

sourceFile.addImportDeclaration({
  moduleSpecifier: "test",
  namedImports: [
    {
      // this is missing
      isTypeOnly: true,
      name: "test",
    },
  ],
});

isTypeOnly should be defineable for Named Imports.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants