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

no-useless-rename should also report pattern properties with default values #12301

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 bug ESLint is working incorrectly enhancement This change enhances an existing feature of ESLint rule Relates to ESLint's core rules

Comments

@mdjermanovic
Copy link
Member

What rule do you want to change?

no-useless-rename

Does this change cause the rule to produce more or fewer warnings?

more

How will the change be implemented? (New option, new default behavior, etc.)?

New default behavior, because I think this is more a bug than an enhancement.

But, there is a question would it be okay for a semver-minor release.

Please provide some example code that this change will affect:

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

const { a: a = 1 } = foo;

What does the rule currently do for this code?

Nothing.

What will the rule do after it's changed?

Error, same as for const { a: a } = foo; and autofix to:

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

const { a = 1 } = foo;

Are you willing to submit a pull request to implement this change?

Yes.

@mdjermanovic mdjermanovic added bug ESLint is working incorrectly enhancement This change enhances an existing feature of ESLint rule Relates to ESLint's core rules evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Sep 22, 2019
@kaicataldo
Copy link
Member

I agree that this is a good candidate for a semver-minor bug fix. I can’t think of a good reason why the two cases illustrated above should result in different errors.

@kaicataldo
Copy link
Member

I've verified this using the ESLint demo.

@kaicataldo kaicataldo added accepted There is consensus among the team that this change meets the criteria for inclusion and removed evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Sep 27, 2019
platinumazure pushed a commit that referenced this issue Sep 29, 2019
…12322)

* Update: no-useless-rename also reports default values (fixes #12301)

* Refactor
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Mar 29, 2020
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Mar 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.