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

prevent-abbreviations: Do not rename exported TypeScript types #1103

Merged
merged 1 commit into from Feb 17, 2021

Conversation

Vages
Copy link
Contributor

@Vages Vages commented Feb 17, 2021

Fixes #1102

This required me to change the output of an existing test case. I have tried my best to see if I made a mistake there, but the only conclusion I could come to was that if you agree with my diagnosis in #1102 , you should also agree with the fix.

A similar test case did not have to be refactored. I'm really not sure why, but this is a test case for the babel-eslint parser, which I guess could be parsing the code as Flow – consequently without the same fixes.

Note: I could also add a fix for Flow types, if that's desirable.

runTest.babelLegacy({
	valid: [],
	invalid: [
		// https://github.com/facebook/relay/blob/597d2a17aa29d401830407b6814a5f8d148f632d/packages/relay-experimental/EntryPointTypes.flow.js#L138
		{
			code: outdent`
				export type PreloadProps<TExtraProps = null> = {};
			`,
			output: outdent`
				export type PreloadProperties<TExtraProperties = null> = {};
			`,
			errors: [...createErrors(), ...createErrors()]
		}
	]
});

@sindresorhus sindresorhus changed the title Do not rename exported typescript types (#1102) Do not rename exported TypeScript types Feb 17, 2021
@sindresorhus sindresorhus changed the title Do not rename exported TypeScript types prevent-abbreviations: Do not rename exported TypeScript types Feb 17, 2021
@Vages
Copy link
Contributor Author

Vages commented Feb 17, 2021

Would you like me to fix this for the babel-eslint cases too, @fisker ? (I'll do that as a separate PR)

@sindresorhus sindresorhus merged commit 5c08932 into sindresorhus:main Feb 17, 2021
@sindresorhus
Copy link
Owner

Would you like me to fix this for the babel-eslint cases too, @fisker ? (I'll do that as a separate PR)

Yes, that would be great :)

@Vages
Copy link
Contributor Author

Vages commented Feb 17, 2021

Comin' right up, @sindresorhus!

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

Successfully merging this pull request may close these issues.

prevent-abbreviations renames exported type declarations in Typescript
3 participants