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

feat: Support arbitrary module namespace names in no-useless-rename #15493

Merged
merged 2 commits into from Jan 10, 2022

Conversation

mdjermanovic
Copy link
Member

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an item)

[ ] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[x] Changes an existing rule (template)
[ ] Add autofix to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:

Refs #15465, fixes no-useless-rename.

What changes did you make? (Give an overview)

Updated the no-useless-rename rule to work correctly with quoted module export names.

Before this change:

/* eslint no-useless-rename: error */

import { "foo" as foo } from "mod"; // no error, false negative

export { foo as "foo" } from "mod"; // no error, false negative

export { "foo" as "bar" } from "mod"; // error, false positive

After this change:

/* eslint no-useless-rename: error */

import { "foo" as foo } from "mod"; // error

export { foo as "foo" } from "mod"; // error

export { "foo" as "bar" } from "mod"; // no error

Is there anything you'd like reviewers to focus on?

@mdjermanovic mdjermanovic added rule Relates to ESLint's core rules accepted There is consensus among the team that this change meets the criteria for inclusion feature This change adds a new feature to ESLint new syntax This issue is related to new syntax that has reached stage 4 labels Jan 6, 2022
Copy link
Contributor

@snitin315 snitin315 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

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

LGTM. Would like someone else to verify before merging.

@mdjermanovic
Copy link
Member Author

Merging as there are two approvals.

@mdjermanovic mdjermanovic merged commit 968a02a into main Jan 10, 2022
@mdjermanovic mdjermanovic deleted the issue15465-nouselessrename branch January 10, 2022 20:33
@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Jul 10, 2022
@eslint-github-bot eslint-github-bot bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Jul 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion feature This change adds a new feature to ESLint new syntax This issue is related to new syntax that has reached stage 4 rule Relates to ESLint's core rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants