Skip to content

prevent-abbreviations renames exported type declarations in Typescript #1102

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

Closed
Vages opened this issue Feb 17, 2021 · 1 comment · Fixed by #1103
Closed

prevent-abbreviations renames exported type declarations in Typescript #1102

Vages opened this issue Feb 17, 2021 · 1 comment · Fixed by #1103
Labels

Comments

@Vages
Copy link
Contributor

Vages commented Feb 17, 2021

As opposed to with nearly any other exported declaration, prevent-abbreviations actually renames exported type declarations.

I would expect this to be left alone:

export type RefType = {
  id: string;
  version?: string;
};

but it's actually refactored to

export type ReferenceType = {
  id: string;
  version?: string;
};

This is undesirable behavior, because the imports preserve the original name – consequently, it causes compilation errors

import { RefType as ReferenceType } from '../types/fooTypes';
@Vages Vages added the bug label Feb 17, 2021
@Vages
Copy link
Contributor Author

Vages commented Feb 17, 2021

I'll be giving this a go in the next hour. If I do not make a sound (or a PR), it's up for grabs.

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.

1 participant