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

Comments

@mdjermanovic
Copy link
Member

@mdjermanovic mdjermanovic commented Sep 22, 2019

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.

@kaicataldo

This comment has been minimized.

Copy link
Member

@kaicataldo kaicataldo commented Sep 23, 2019

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

This comment has been minimized.

Copy link
Member

@kaicataldo kaicataldo commented Sep 27, 2019

I've verified this using the ESLint demo.

@kaicataldo kaicataldo added accepted and removed evaluating labels Sep 27, 2019
kaicataldo added a commit that referenced this issue Sep 27, 2019
kaicataldo added a commit that referenced this issue Sep 27, 2019
kaicataldo added a commit that referenced this issue Sep 28, 2019
kaicataldo added a commit that referenced this issue Sep 29, 2019
platinumazure added a commit that referenced this issue Sep 29, 2019
…12322)

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

* Refactor
@eslint eslint bot locked and limited conversation to collaborators Mar 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.