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

Repo: Enable TypeScript's "strict" mode #118

Open
JoshuaKGoldberg opened this issue Sep 5, 2024 · 1 comment
Open

Repo: Enable TypeScript's "strict" mode #118

JoshuaKGoldberg opened this issue Sep 5, 2024 · 1 comment

Comments

@JoshuaKGoldberg
Copy link
Contributor

Coming over from https://github.com/eslint/rewrite/pull/117/files#r1742735782: TypeScript's compilerOptions.strict "enables a wide range of type checking behavior that results in stronger guarantees of program correctness. Turning this on is equivalent to enabling all of the strict mode family options... You can then turn off individual strict mode family checks as needed." Enabling strict is generally a TypeScript best practice. It's generally considered a must-have whenever possible: i.e. except when a pre-existing project is too large to easily migrate.

The two most impactful strict options are:

I understand there maybe some reluctance to enable strict on this repo. I think there was a discussion prior to #117 but I can't find it on demand. Are there strong reasons not to enable strict here?

@nzakas
Copy link
Member

nzakas commented Sep 5, 2024

My main concern is the amount of effort required to meet strict mode out of the gate. At least in my (somewhat limited) experience, I've ended up running into issues where dependencies don't have type definitions and then I'm forced to create them (levn for example) or needing to reconcile types between packages we don't control (i.e., @types/eslint).

As someone who has a very limited number of hours I can devote to ESLint, spending those hours fighting with types doesn't seem like the best use of my time. (Or the team's time, where they may also be limited.)

It seems like we get around 80% of the benefit of type checking without strict mode.

That said, I'm not against strict mode in theory, I'm much more worried about it in practice. But I suppose if someone wants to come along and clean up my sloppy TypeScript behind me, I wouldn't mind that. 😄

I'm curious what others think.

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

No branches or pull requests

2 participants