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

Consider using Typescript strict flag #6769

Closed
danilofuchs opened this issue Jan 21, 2021 · 2 comments
Closed

Consider using Typescript strict flag #6769

danilofuchs opened this issue Jan 21, 2021 · 2 comments
Assignees

Comments

@danilofuchs
Copy link

Great job on the Typescript Migration!

strict is one of the most useful Typescript flags to catch cannot access key of undefined errors early on.

Flag documentation

https://www.typescriptlang.org/tsconfig#strict

Migration process

Having worked on migrating a big non-strict project to strict mode, I know it is quite the undertaking. Typescript does not allow to apply a flag to a single file, so enabling it directly would mean porting the entire codebase at once, which is very error-prone.

However, I have used ts-strictify to run an additional CI check if enabling strict flag would break any changed files. This way, we can be sure any new code is strict.

@jackfranklin
Copy link
Collaborator

Would definitely like to do this and it's unfortunate we can't turn it on file by file.

I wonder if rather than immediately leaping to strict: true, if we could turn on all the flags that strict: true implies one-by-one in PRs? That way we might not have to fix ~400 errors all at once and might be able to bring it down.

@OrKoN
Copy link
Collaborator

OrKoN commented Nov 11, 2021

We could turn the flag on locally and fix issues, then submit those patches with strict: false. In the end, we'd hopefully only need to fix a few regressions in the final PR that turns on strict true. We can also go by individual components but I am afraid most of errors are about getting data from hash maps.

OrKoN added a commit that referenced this issue Jan 21, 2022
OrKoN added a commit that referenced this issue Jan 21, 2022
OrKoN added a commit that referenced this issue May 4, 2022
Solves type issues in HTTPRequest/Response with some slight changes in the behaviour and API.

Issues #6769
OrKoN added a commit that referenced this issue May 5, 2022
Solves type issues in HTTPRequest/Response with some slight changes in the behaviour and API.

Issues #6769
OrKoN added a commit that referenced this issue May 5, 2022
Solves type issues in HTTPRequest/Response with some slight changes in the behaviour and API.

Issues #6769
This was referenced May 30, 2022
This was referenced May 30, 2022
@OrKoN OrKoN closed this as completed Jun 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment