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

Stricter TypeScript #42

Merged
merged 4 commits into from
Aug 1, 2023
Merged

Stricter TypeScript #42

merged 4 commits into from
Aug 1, 2023

Conversation

WarningImHack3r
Copy link
Member

Make TypeScript even stricter. Here are the changes:

  • Use @total-typescript/ts-reset and import it in src/reset.d.ts (I guess every src/**/*.d.ts is imported by default). Click on it to see all its benefits.
  • Set the noUncheckedIndexedAccess rule to true in tsconfig.json to make TS consider the following:
     const a = ["a", "b", "c"];
     const b = a[1]; // Now typed `string | undefined` instead of `string`

There might be some other rules to enable/set by making a tour of all the tsconfig rules but I guess we're fine like this.

@WarningImHack3r WarningImHack3r merged commit 98cd777 into main Aug 1, 2023
3 checks passed
@WarningImHack3r WarningImHack3r deleted the stricter-ts branch August 1, 2023 15:19
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

Successfully merging this pull request may close these issues.

2 participants