2

Is there a way to get Visual Studio to be consistent about the way it represents Array<> types in TypeScript? I'd prefer it to encapsulate the type in Array (like it is written) all the time instead tacking [] to the end because the former is much more readable on long types (much easier to follow what is part of the array and also reads left to right much better)

enter image description here

Brad
  • 11,934
  • 4
  • 45
  • 73
  • You've tagged this with [visual-studio] and not [visual-studio-code], so I'll let others chime in with an answer. If you are in fact using VSCode, you may want to try the solutions on [this question](https://stackoverflow.com/q/62508909/215552) a try. It talks about `noErrorTruncation`, but it seems to affect more than errors. – Heretic Monkey Aug 31 '23 at 20:15
  • 1
    @HereticMonkey The tag is, in fact, correct. I am not using VS Code. – Brad Aug 31 '23 at 20:59

1 Answers1

0

There ist actually a difference between Array and []. Take a Look at this explanation. Here ist also an additional TypeScript explanation, which points out your problem between the Type difference.

i3ene
  • 71
  • 5
  • I concur that there is not a difference (except maybe where there is with readonly? in which case `[]` is ambiguous). I'd like the type to be rendered in the hovertext the same way it is written. Putting the `[]` at the end makes visually parsing the type onerous. – Brad Aug 31 '23 at 22:40