-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to group errors together #15550
Comments
How would this feel?
|
would that be something that your IDE supports? like VS has sort by Error code as well as source file. VS Code does not seem to have that.. |
@RyanCavanaugh Yes, that would also be an option, I like the indentation, if you skim over the log output you can quickly identify grouped errors and move on. Sou you want to group errors by exact error message? Meaning several TS2339 errors in Util.js would result in this:
I think that approach would work pretty well. -- |
This doesn't seem to come up often to to warrant what would ultimately be a pretty complex solution. |
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:
The output should be more like this, 1 line per file:
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 otherTS2339
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
orjsconfig.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?The text was updated successfully, but these errors were encountered: