Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

useSimpleNumberKeys #3888

Closed
Tracked by #3953 ...
ematipico opened this issue Nov 28, 2022 · 3 comments · Fixed by #4447
Closed
Tracked by #3953 ...

useSimpleNumberKeys #3888

ematipico opened this issue Nov 28, 2022 · 3 comments · Fixed by #4447
Labels
A-Linter Area: linter I-Normal Implementation: normal understanding of the tool and awareness

Comments

@ematipico
Copy link
Contributor

ematipico commented Nov 28, 2022

simple-number-keys (autofix e.g. 0x1 to 1, safe)

// valid for now
// ESLint already catches properties keyed with different-formatted number literals, we haven't implemented it yet.
({ 0x1: 1, 1: 2 });
({ 012: 1, 10: 2 });
({ 0b1: 1, 1: 2 });
({ 0o1: 1, 1: 2 });
({ 1n: 1, 1: 2 });
({ 1_0: 1, 10: 2 });
// This particular simple computed property case with just a string literal would be easy to catch,
// but we don't want to open Pandora's static analysis box so we have to draw a line somewhere
({ a: 1, ["a"]: 1 });

cc @jeysal

@ematipico ematipico mentioned this issue Nov 28, 2022
29 tasks
@ematipico
Copy link
Contributor Author

The issue #3731 contains more context about the rule.

@ematipico ematipico added the I-Normal Implementation: normal understanding of the tool and awareness label Dec 6, 2022
@dhrjarun
Copy link
Contributor

dhrjarun commented Dec 21, 2022

Hey @ematipico, can I try this?

@ematipico
Copy link
Contributor Author

All yours! Thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Linter Area: linter I-Normal Implementation: normal understanding of the tool and awareness
Projects
Status: Done
3 participants