Skip to content
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

Re-enable useUnknownInCatchVariables #452

Open
dkundel opened this issue Jan 11, 2023 · 0 comments
Open

Re-enable useUnknownInCatchVariables #452

dkundel opened this issue Jan 11, 2023 · 0 comments

Comments

@dkundel
Copy link
Member

dkundel commented Jan 11, 2023

TypeScript v4.4 changed the type of errors caught in a catch clause to be unknown as opposed to any. In order to ease the transition from v3 to v4 we turned this off in #450. Ideally we should enable this again for better type checking. This requires the following changes:

  1. Turn on useUnknownInCatchVariables in the tsconfig.base.json
  2. Run npm run build and see which files fail.
  3. Add type guards to convert unknown to the right relevant type and handle cases where it's a different type
  4. Re-run npm run build to validate that everything compiles correctly.

To do a more iterative approach you can also enable useUnknownInCatchVariables inside each individual tsconfig.json in the respective packages first before enabling it entirely.

@dkundel dkundel mentioned this issue Jan 11, 2023
10 tasks
@makserik makserik added this to the Improvements/Nice to haves milestone Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants