Skip to content

Unnecessary @ts-ignore of utils #499

Description

@PatrykKuniczak

Describe the feature

I think this part of code isn't longer necessary:

unimport/src/utils.ts

Lines 247 to 266 in e908b92

// TypeScript incorrectly reports an error when re-exporting types in a d.ts file.
// We use @ts-ignore to suppress the error since it actually works.
const strings: string[] = []
if (typeImports.size) {
const typeImportNames = Array.from(typeImports).map(({ name, as }) => {
if (as && as !== name)
return `${name} as ${as}`
return name
})
strings.push(
'// @ts-ignore',
`export type { ${typeImportNames.join(', ')} } from '${from}'`,
)
}
if (starTypeImport) {
strings.push(
'// @ts-ignore',
`export type * as ${starTypeImport.as} from '${from}'`,
)
}

TS doesn't report any error anymore.

Additional information

  • Would you be willing to help implement this feature?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions