-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Stabilize error code, have an error listing, and for each error code have a webpage that explains it #298
Comments
We've talked about this in the past - We don't want to stabilize the |
I agree readable short names would be better error code for the public consumption. Anyway, I do think this would help with people experience fixing errors in their TS code. |
Aye, there's about 1,200 compiler messages to go through. I've ran a few bug bashes before, I wonder if it's feasible for us to do a one-off community event over a weekend in trying to handle it. Could try to generate (or find the compiler tests) a reproduction for each compiler flag (I get this can be very complex for some, but the majority should be doable) as well as a short code which could be used to seed these kind of docs. |
I think human-readable codes are (maybe) useful for suppression, but it's not clear to me what value a webpage explainer for a majority of these gives. For example, let's look at a few error messages at the beginning of
Are we supposed to have a webpage with each of these explained? Is the explanation for each of these just the rationale of a design decision? Maybe instead we only document a subset of error messages. If so, which? And if it's only a few, does it make sense to have an entire section of the website dedicated to this? I really need to understand what the use-case is because this gets brought up a lot, but I don't know why we would do this instead of making the error messages better in specific cases. |
You can try asking 10 new JS users who have never used TS what those 3 messages would mean to them, and how they would handle that error. |
Linters such as ESLint have a webpage for each error code:
For example, no-console
TypeScript gives back mystic codes:
that leads to a bunch of SO answers and blog posts:
In VS Code, we added the ability to have links for diagnostics: microsoft/vscode#11847
I request TS to stabilize error codes, provide a webpage listing of all errors, and one webpage for each error code to explain it. TS errors in editor can then be linked to the official docs.
The text was updated successfully, but these errors were encountered: