-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Having a pedantic
option in TSConfig in addtion to strict
#56028
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
FWIW you can achieve this by extending |
@RyanCavanaugh previously argued against such a flag. https://gist.github.com/RyanCavanaugh/f80f9ddc50d45c4d76e7c4101efada28#should---pedantic-exist Related: #38905 |
I have responded to Ryan's gist. @jakebailey that's super useful, thank you! |
I second that. I agree with @docwilco 's comments in the gist, especially to include in a particular error the very flag that lead to it being reported. I'd like to use this flag as well in a form of front-runner CI build that warns me in advance of possible things to watch out for when new TypeScript versions arrive. |
I agree. |
ha ha only serious: just make pedantic the default and let people take off the guard rails if they think they have to. |
Another possibility is an option
|
🔍 Search Terms
"tsconfig pedantic" "tsconfig setting" "tsconfig noimplicitreturn" "tsconfig noimplicitreturn pedantic"
✅ Viability Checklist
⭐ Suggestion
It would be nice to have a
pedantic
option intsconfig.json
, along the lines ofstrict
, but basically turning on everything.I currently have the following, for instance:
This turns on all checks listed in the documentation, but it was a bit of a slog to figure out which options weren't covered by the first line (
"strict": true
). Also, if new Type Checking settings were introduced, I would have to figure that out and add them manually.I would propose a simple option
pedantic
, which sets all of the options to their most strict option. Basically replacing the whole list above with a single line of"pedantic": true
. When new settings are added, they would automatically be covered by this.📃 Motivating Example
If
strict
is good,pedantic
should be better. Not everybody can use it in all situations, but these settings exist for a reason, and this would be the easiest way to turn them all on.Of course individual settings can still be overridden, in case specific code needs that. But programmers striving to write TypeScript as clean as possible will be able to have the compiler help them as much as possible with this.
All of the Type Checking settings exist for good reasons, let's make it easy for people to use them all.
💻 Use Cases
What do you want to use this for?
Learning to write the cleanest of TypeScript code.
What shortcomings exist with current approaches?
Having to manually scour the documentation/changelog for TypeScript to find out what Type Checking settings aren't covered by
strict
What workarounds are you using in the meantime?
See the previous point
The text was updated successfully, but these errors were encountered: