This repository has been archived by the owner on Aug 31, 2023. It is now read-only.
useLiteralKeys
rule should cover object properties
#4664
Conaclos
started this conversation in
Suggestions
Replies: 1 comment
-
Great suggestion! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The
useLiteralKeys
lint rule reports code where static property access can be used instead of computed acces.This implements the EsLint
dot-notation
rule.The EsLint
no-useless-computed-key
rule reports useless computed keys on an object literal:I suggest merging these two EsLint rule into
useLiteralKeys
.The only minor inconsistency in the rule name is the simplification of
["1+1"]
to"1+1"
.The rule could also handle the following cases:
This could also be done on interfaces and object types.
This is not a breaking change since
useLiteralKeys
is a nursery rule.Beta Was this translation helpful? Give feedback.
All reactions