Skip to content

Breaks TypeScript module declarations #152

@flying-sheep

Description

@flying-sheep

Hi! Thanks for the work, this is pretty nice!

There’s an edge case where it breaks code though:

I have the file react-app-env.d.ts. It has the following content:

declare module '@okta/okta-signin-widget' {
  import { OktaAuth, OktaAuthOptions, Tokens } from '@okta/okta-auth-js'
  ...
}

declare module 'axios/lib/helpers/isAxiosError' {
  import { AxiosError } from 'axios'
  export default function isAxiosError(error: unknown): error is AxiosError
}

Running this plugin (“module” style) generates the following broken code:

declare module '@okta/okta-signin-widget' {
  import { OktaAuth, OktaAuthOptions, Tokens } from '@okta/okta-auth-js'
  import { AxiosError } from 'axios'
  ...
}

declare module 'axios/lib/helpers/isAxiosError' {
  export default function isAxiosError(error: unknown): error is AxiosError
}

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