📎 `useShorthandArrayType` should handle read-only arrays
Description
Summary
For now, Rome's useShorthandArrayType does not handle read-only arrays.
ESLint's rule array-type handles read-only arrays.
Examples
This code:
const y: ReadonlyArray<string> = ['a', 'b'];
should be turned into:
const y: readonly string[] = ['a', 'b'];
I'll take a look.
👋 @rome/staff please triage this issue by adding one of the following labels: S-Bug: confirmed, S-Planned , S-Wishlist or umbrella
We need to be careful with this problem here: https://github.com/rome/tools/issues/3111
I guess we may not need to handle #3111 for now.
My understanding is that current rome's useShorthandArrayType follows typescript-eslint's array-type (array-simple).
In this case, e.g. const c: Array<() => void> = [() => {}]; is correct (it doesn't need a suggested fix).
And, the current playground doesn't suggest the fix.
Please comment if I'm wrong.