Description
TypeScript Version: 2.3.1
Use Case
I'm currently checking a huge(60+ files) js code base with the new // @ts-check
option added in 2.3.1.
It works great and I started with 1 file, gradually adding more and more files to check, however in every file there are DOM manipulations and TypeScript rightfully complains about them, however after a while the log is FULL of TS2339
errors and it's incredibly hard to find other errors that I'm more interested in like missing variables or wrong assignments.
It would be really helpful if the compiler could group errors together to conserve space, so errors like TS2339
would only occupy 1 line per file instead of 1 line per occurrence.
Unless there's a // @ts-check
way of telling the compiler that it is indeed a HTMLInputElement. I tried it with JSDoc syntax but to no avail.
I understand this is only helpful for people who use the // @ts-check
option since you can always cast in a TS environment, but since you can now check pure JS it would be really helpful to group errors together for the use case described above.
So instead of this:
javascript/util/Util.js(134,69): error TS2339: Property 'value' does not exist on type 'HTMLElement'.
javascript/util/Util.js(137,61): error TS2339: Property 'value' does not exist on type 'HTMLElement'.
javascript/util/Util.js(139,61): error TS2339: Property 'value' does not exist on type 'HTMLElement'.
javascript/util/Util.js(147,57): error TS2339: Property 'value' does not exist on type 'HTMLElement'.
The output should be more like this, 1 line per file:
javascript/util/Util.js(134,69), (137,61), (139,61), (147,57): error TS2339.
I know this isn't ideal because it would also affect non DOM queries as TS2339
is not exclusive to it, but I get A LOT and I looked through all of them, eliminated all the other TS2339
occurences so now only the DOM queries remain and I would like them to occupy less space in my log output.
Idk if it makes sense to specify it in the tsconfig.json
or jsconfig.json
file, as it's more of an adhoc behaviour where if you see that your log is getting cluttered with a specific error you would then like to group those error messages to preserve space.
e.g tsc -groupErrors TS2339
Maybe even a // @ts-check
style comment to group it on a per file basis?