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

Breaks TypeScript module declarations #152

Open
flying-sheep opened this issue Feb 16, 2022 · 0 comments
Open

Breaks TypeScript module declarations #152

flying-sheep opened this issue Feb 16, 2022 · 0 comments

Comments

@flying-sheep
Copy link

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
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant