-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Rename TSConfig option categories #42514
Conversation
I don't know how I feel about this change - I think we should strive to reduce tsconfig.json itself. A lot of these are way more rare options that I would never suggest a new user think about:
|
I guess I misread the change - looks like we're not adding stuff, just recategorizing. Still, I think long term we should try to pare this thing down. |
"compilerOptions": { | ||
"locale": "someString" | ||
} | ||
"compilerOptions": {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting that it was shown before and not now..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, locale used to be an Advanced Option
which meant it would have passed that previous if
check - but the flag only works on the CLI (and so it's not in the tsconfig reference for example), so I felt moving it into command line options was probably the right call
name: "locale",
type: "string",
- category: Diagnostics.Advanced_Options,
+ category: Diagnostics.Command_line_Options,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not command line only option... it can be present in tsconfig ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just confirmed to make sure, tsc ignores locale in a tsconfig
❯ cat tsconfig.json
{
"files": [
"broke.ts"
],
"compilerOptions": {
"locale": "cs",
}
}
❯ pnpm tsc
broke.ts:2:7 - error TS1134: Variable declaration expected.
2 const 123 = 123
~~~
Found 1 error.
❯ pnpm tsc --locale cs
broke.ts:2:7 - error TS1134: Očekává se deklarace proměnné.
2 const 123 = 123
~~~
Našla se 1 chyba.
and just in case it's a top level attribute:
❯ cat tsconfig.json
{
"files": [
"broke.ts"
],
"locale": "cs",
}
❯ pnpm tsc
broke.ts:2:7 - error TS1134: Variable declaration expected.
2 const 123 = 123
~~~
Found 1 error.
It can be considered a bug? but the switch at least makes sense for how TS acts today
Hah, yeah, you're a braver man than me Daniel to think about removing tsconfig entries! At least this change makes the list of deprecated flags longer |
I've given this a rebase, and updated it from the 2 times it came up in language design meetings - should be good for another review @sheetalkamat ❤️ |
"compilerOptions": { | ||
"locale": "someString" | ||
} | ||
"compilerOptions": {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not command line only option... it can be present in tsconfig ?
We had a docs meeting about this at the end of 2020, which resulted in this set of categories
The docs changes are mostly just trivial, but there is code in
showConfig
which relied on behavior in that any config option in advanced types would not show in certain circumstances. This is what I'm not 100% sure on, is this setup acceptable? The diff in tests is mostly just re-ordering.