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

[eslint-plugin] fix(no-deprecated-type-references): handle name conflicts with import aliases for new types #5708

Merged
merged 1 commit into from
Oct 31, 2022

Conversation

adidahiya
Copy link
Contributor

Checklist

  • Includes tests
  • Update documentation

Changes proposed in this pull request:

Improve @blueprintjs/no-deprecated-type-references lint rule implementation to detect name conflicts for the new symbols. In these cases the rule will now alias the new type name with a "Blueprint" prefix, such as { Props as BlueprintProps }.

Reviewers should focus on:

New test cases

@adidahiya adidahiya requested a review from gluxon October 31, 2022 19:54
Copy link
Contributor

@gluxon gluxon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fantastic. Thank you. ❤️

Comment on lines +52 to +54
} else if (options.alias !== undefined && nodeToReplace.local.name !== nodeToReplace.imported.name) {
throw new Error(
`Existing import '${nodeToReplace.imported.name}' is already aliased as '${nodeToReplace.local.name}', refusing to rename with new alias '${options.alias}'`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch of this situation!

@blueprint-bot
Copy link

[eslint-plugin] fix(no-deprecated-type-references): deal with name conflicts

Previews: documentation | landing | table | demo

@adidahiya adidahiya changed the title [eslint-plugin] fix(no-deprecated-type-references): deal with name conflicts [eslint-plugin] fix(no-deprecated-type-references): handle name conflicts with import aliases for new types Oct 31, 2022
@adidahiya adidahiya merged commit ea2e940 into develop Oct 31, 2022
@adidahiya adidahiya deleted the ad/fix-deprecated-type-references-name-conflicts branch October 31, 2022 20:00
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.

None yet

3 participants