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

Check object literals as part of no-useless-rename #11041

Closed
paulmelnikow opened this issue Oct 31, 2018 · 4 comments

Comments

@paulmelnikow
Copy link
Contributor

commented Oct 31, 2018

What rule do you want to change?

no-useless-rename

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

More warnings

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

New option + new default behavior

Please provide some example code that this change will affect:

const a = 123
const b = {a: a}

What does the rule currently do for this code?

No warning is generated for this code.

What will the rule do after it's changed?

  2:12  error  Object literal a unnecessarily renamed  no-useless-rename

✖ 1 problem (1 error, 0 warnings)

When ignoreLiteral is true, the warning will be suppressed (same as current behavior).

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

If no one else feels inclined!

@eslint eslint bot added the triage label Oct 31, 2018

@not-an-aardvark

This comment has been minimized.

Copy link
Member

commented Oct 31, 2018

Hi, thanks for the proposal.

I'm a bit confused because I'm not sure I understand the problem with the code above. How would the rule recommend writing it instead?

Also, does the object-shorthand rule already cover this case?

@platinumazure

This comment has been minimized.

Copy link
Member

commented Oct 31, 2018

Is this covered by object-shorthand? I'm confused, maybe I'm missing something.

@paulmelnikow

This comment has been minimized.

Copy link
Contributor Author

commented Oct 31, 2018

Ah! So it is. Maybe I can add a cross-reference in the documentation. Thanks!

@platinumazure

This comment has been minimized.

Copy link
Member

commented Oct 31, 2018

A documentation PR to add cross-reference(s) would be wonderful, thanks!

not-an-aardvark added a commit that referenced this issue Nov 3, 2018

@eslint eslint bot locked and limited conversation to collaborators Apr 30, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants
You can’t perform that action at this time.