-
-
Notifications
You must be signed in to change notification settings - Fork 66
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
feat(diagnostic
): add missing error codes
#177
feat(diagnostic
): add missing error codes
#177
Conversation
Perhaps users could set additional diagnostic codes in their |
diagnostic
): add codes for exactOptionalPropertyTypes: true
diagnostic
): add missing error codes
Added |
👍 |
Do you plan to work on this? No pressure, but I need to know whether or not to release a new version after merging this. |
I did start attempting to add the updated error message, but it‘s a little more involved because the Should we just update the error message and add the code there, or report the code on all diagnostics? |
It would be too noisy to have the code on all diagnostics. |
Fixes #170. Fixes #143.
Adds missing diagnostic codes:
ts2375
,ts2379
, andts2412
, which occur whenexactOptionalPropertyTypes
is set totrue
intsconfig.json
.ts2542
, which occurs when attempting to modify a readonly key in an object.Related, I think it's worth improving the error reporting when
expectError
fails. Currently, it reportseven if another error is reported for the same invocation (i.e.,
tsd
doesn't support that diagnostic code). We could change it to:I used the following snippet in
compiler.ts
to confirm whichDiagnosticCode
to add1:I think it would be worthwhile to either report the codes of all diagnostics (potentionally in a
--verbose
mode?), or at the very least in theexpectError
message:Footnotes
Full list here. ↩