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

Enable Typescript "strict" mode across the repo #792

Open
16 of 21 tasks
tsa96 opened this issue Jul 24, 2023 · 0 comments
Open
16 of 21 tasks

Enable Typescript "strict" mode across the repo #792

tsa96 opened this issue Jul 24, 2023 · 0 comments
Labels
Priority: Medium Something that should be tried to be done in this release, but not as important as High priority. Size: Large Something that may take a week up to a month to implement. Type: Dev/Internal Something that is more internal to development than end user facing. Type: Enhancement Something that builds on top of what already exists

Comments

@tsa96
Copy link
Member

tsa96 commented Jul 24, 2023

When we started the rewrite we didn't enable "strict": true in our tsconfigs, which was a mistake. It provides much stronger type-checking, especially for forcing you to handling possible undefined and nulls better.

I had a quick go and switching over when doing the Nx migration but found class-validator too annoying and forgot about it. Sikari in Discord recommends these settings

"strict": true,
"downlevelIteration": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"strictPropertyInitialization": false,

Let's aim to get "strict": true in our root tsconfig.json and any projects that really need it disabled (maybe backend E2E tests) can override in their own tsconfig. If we can do E2E tests as well then great, but doesn't matter at all as much. Most of our libraries are using strict mode already, but frontend and backend apps have it off:

  • apps/frontend
  • apps/frontend-e2e
  • apps/backend
  • apps/backend-e2e (can maybe ignore)
  • libs/frontend/data
  • libs/frontend/directives
  • libs/frontend/icons
  • libs/frontend/env
  • libs/frontend/pipes
  • libs/frontend/theme
  • libs/backend/config
  • libs/backend/decorators
  • libs/backend/dto
  • libs/backend/pipes
  • libs/backend/test-utils
  • libs/backend/validators
  • libs/bitflags
  • libs/constants
  • libs/enum
  • libs/random
  • libs/replay
@tsa96 tsa96 added Type: Enhancement Something that builds on top of what already exists Priority: Medium Something that should be tried to be done in this release, but not as important as High priority. Size: Large Something that may take a week up to a month to implement. Type: Dev/Internal Something that is more internal to development than end user facing. labels Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Medium Something that should be tried to be done in this release, but not as important as High priority. Size: Large Something that may take a week up to a month to implement. Type: Dev/Internal Something that is more internal to development than end user facing. Type: Enhancement Something that builds on top of what already exists
Projects
None yet
Development

No branches or pull requests

1 participant