-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Allow --strict to take a version number #18776
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
Comments
One of the biggest challenges with |
For me, the whole purpose of |
If you're trying to preemptively say "strict, but no future strict stuff", you can just list all the individual tags currently grouped under "strict", instead of using "strict" directly. The flag even came with the promise, as @gcnew mentioned, that more strictness checks would be added to it in the future... I feel like the version tag is both somewhat redundant and subverts the flag's goal. |
I actually think It feels to me like it is a solution looking for a problem. Not only would it have to be in the |
I'm also not a fan. As Daniel pointed out to me when we discussed this yesterday, there's not really an observable difference between |
This would be confusing. It implies that a given version of the language is potentially aware of both past and future versions. It would also seem to suggest that the right way to think about new checks is in the context of language versions when in fact there are individual flags for all significant new strictness improvements precisely because they cross cut with other language improvements. I would argue that if a new |
Major points from SBS
|
Uh oh!
There was an error while loading. Please reload this page.
This is mostly from offhand conversations with @wycats, but I needed to finally file this on the issue tracker.
Background
One of the stances that we've taken is that
strict
opts you into all strictness settings unless users specifically opt out. That way, users can upgrade, and only if they experience breaks do they need to manually turn options off.This has some benefits of pushing users towards writing safer code and avoiding bugs (and often getting a better experience in general), but users may not want to have their semantics changed under them by an upgrade, or have to look into new options right away.
Proposal
One way we can alleviate this is by allowing users to lock down their strictness settings by version number. For example, right now we are experimenting adding a new
--strictFunctionTypes
option under the--strict
bucket. For users to avoid this, they could writeinstead of
Upsides
I think @wycats might do a better job with the benefits.
Downsides
Here are some concerns I've come up with off the top of my head:
--strict
version number than to lock down on major.minor in npm?2.5
) instead of a string (i.e"2.5"
) intsconfig.json
? Because inevitably, someone will use a number instead of a string and they will be unhappy when it doesn't work.The text was updated successfully, but these errors were encountered: