-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Consider collapsing multiple repeated type-related error messages when in --pretty #23393
Comments
#10489 and #22789 both discuss the idea of related spans which could be leveraged here, but you really want to cut down on these. We could defer all "cannot find" error messages to the end of the checking process and potentially de-dupe in that fashion. The problem is that you really want to still present the related spans outside of |
Revisit once we have general multi-location diagnostic support. Some notes in #23444 |
I think this should also cover |
We have had a discussion about this offline. An observation here is that usually the duplicate declaration errors are caused by including the same module/declaration file more than once. so the result is multiple duplicate declaration errors for the same 2 files. A proposal for improvement here is if we notice a single file has more than X (say 5) duplicate declaration errors with the same file, then only report the first one with an elaboration saying that there are multiple errors there. #25324 track this suggestion. |
Also, related to this is #15550 |
with #25324, I think we can call the underlying issue addressed. |
Search Terms: error message pretty collapsing
The TS team started a few conversations in TSConf 2018 about making TypeScript error messages more friendly to newcomers. One good first one to approach could be repeated, near-identical errors around the same type.
Code
For example, if a type is missing multiple times in the same file:
Expected behavior:
In a debatably perfect world, TypeScript could give a single error message for the repeated class of error:
Actual behavior:
Three separate errors.
Perhaps a post-processing step in
--pretty
mode that receives all of a file's errors and smooshes them down when it can?Some open questions:
--pretty
output but with line+column removed?The text was updated successfully, but these errors were encountered: