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 strict mode in Typescript #2132

Open
grahamalama opened this issue Oct 27, 2021 · 3 comments
Open

Enable strict mode in Typescript #2132

grahamalama opened this issue Oct 27, 2021 · 3 comments

Comments

@grahamalama
Copy link
Contributor

As discussed in #2119, enabling strict mode in the Typescript compiler would reduce the chance of certain types of bugs occurring.

Running tsc --strict reports 321 errors. Trying to fix these errors in one PR would be a bit daunting. Instead, there might be a way to gradually enable strict checking on a per file/directory basis. There doesn't seem to be a Typescript-official way to do this, but this package looks like it could be helpful.

@grahamalama
Copy link
Contributor Author

Another option to bring the codebase up to strict compliance would be to enable the compiler rules that comprise strict mode one at at time. Those are:

strictNullChecks
strictBindCallApply
strictFunctionTypes
strictPropertyInitialization
noImplicitAny
noImplicitThis
useUnknownInCatchVariables

@leplatrem
Copy link
Contributor

That's a good idea! Let's start a branch and use this list as checkboxes. I'm willing to help!

@grahamalama
Copy link
Contributor Author

Typescript strict mode flags applied:

  • strictNullChecks
  • strictBindCallApply
  • strictFunctionTypes
  • strictPropertyInitialization
  • noImplicitAny
  • noImplicitThis
  • useUnknownInCatchVariables

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants