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
Closed

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

paulmelnikow opened this issue Oct 31, 2018 · 4 comments
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion enhancement This change enhances an existing feature of ESLint evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion rule Relates to ESLint's core rules

Comments

@paulmelnikow
Copy link
Contributor

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-deprecated eslint-deprecated bot added the triage An ESLint team member will look at this issue soon label Oct 31, 2018
@not-an-aardvark
Copy link
Member

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
Copy link
Member

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

@platinumazure platinumazure added 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 and removed triage An ESLint team member will look at this issue soon labels Oct 31, 2018
@paulmelnikow
Copy link
Contributor Author

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

@platinumazure
Copy link
Member

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

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Apr 30, 2019
@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 Apr 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion enhancement This change enhances an existing feature of ESLint evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion rule Relates to ESLint's core rules
Projects
None yet
Development

No branches or pull requests

3 participants