This repository was archived by the owner on Aug 31, 2023. It is now read-only.
useShorthandArrayType rule is too broad
#4371
Closed
jpike88
started this conversation in
Suggestions
Replies: 1 comment
-
|
actually screw it im being too anal, it's not so bad as it is |
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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
We have our shorthand array enforced in eslint with the below rule:
The
array-simplequalifier meant that this rule wouldn't just enforce the[]notation on everything, but only simple types. This had the added benefit of theArray<>notation allowing someone at a glance to know whether the referenced type is simple or not. https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/array-type.md#array-simpleI think that requiring
[]for everything is overkill andArray<>has it's place, both can be leveraged for the richest context when reading codeThe desired behaviour would then look like this:

Beta Was this translation helpful? Give feedback.
All reactions