Non-enum CLI options with multiple values separated by comma and space aren't whitespace trimmed
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- typescript
Research direction
Start from the CLI option parsing exercised by the provided npx tsc --showConfig command, comparing the non-enum options with lib handling. Verify the reported options no longer retain a leading space after comma splitting, while the resolved configuration remains otherwise unchanged.
Written by the indexing model from the issue text.
Description
🔎 Search Terms
CLI, compilerOptions, whitespace, comma
🕗 Version & Regression Information
Checked on the latest main
⏯ Playground Link
No response
💻 Code
> npx tsc --showConfig --customConditions "a, b" --types "a, b" --typeRoots "a, b" --moduleSuffixes "a, b" --excludeDirectories "a, b" --excludeFiles "a, b" --lib "es2015, dom" index.ts
🙁 Actual behavior
{
"compilerOptions": {
"customConditions": [
"a",
" b"
],
"lib": [
"es6",
"dom"
],
"moduleSuffixes": [
"a",
" b"
],
"typeRoots": [
"./a",
"./ b"
],
"types": [
"a",
" b"
]
},
"files": [
"./index.ts"
]
}
See space before b in resolved config, and also note that lib values are trimmed correctly
🙂 Expected behavior
{
"compilerOptions": {
"customConditions": [
"a",
"b"
],
"lib": [
"es6",
"dom"
],
"moduleSuffixes": [
"a",
"b"
],
"typeRoots": [
"./a",
"./b"
],
"types": [
"a",
"b"
]
},
"files": [
"./index.ts"
]
}
Non-enum options should be whitespace-trimmed as well
Additional information about the issue
Followup for https://github.com/microsoft/TypeScript/pull/64522#discussion_r4147589423
- Dominant language
- Go
- Stars
- 111k
- Forks
- 16.4k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 149
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/TypeScript
-
Class names `eval` and `arguments` are not reported as invalid strict mode bindingsPossibly taken @dmety claimed this 4 days ago. OpenBug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
microsoft/TypeScript#64661 ·
Maintainers usually reply within 1 day
-
TypeScript 7 VS Code extension: a workspace "typescript" 7.x package is not detected, only "@typescript/native-preview", which is no longer publishedPossibly taken @jakebailey claimed this 5 days ago. OpenNeeds Investigation
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
microsoft/TypeScript#64565 · 1 reaction · 1 assignee ·
Maintainers usually reply within 1 day
-
`EFNoLeadingComments` suppresses synthesized leading comments in tsgo; Strada only suppresses source commentsPossibly taken @weswigham claimed this 12 days ago. OpenNeeds Investigation
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
microsoft/TypeScript#64453 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
enhance: Add tests for premature caching of contextual parameter typesPossibly taken @luchenxu73 claimed this 26 days ago. OpenPossible Improvement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
microsoft/TypeScript#64278 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
dom.generated.d.ts is missing from this repo while still referenced in the docsMay be free again @seanxuu claimed this 38 days ago, and no pull request is open. OpenDocs
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
microsoft/TypeScript#64118 · 1 comment ·
Maintainers usually reply within 1 day
All issues in microsoft/TypeScript
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
homarr-labs/dashboard-icons#2939 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
AvengeMedia/DankMaterialShell#3761 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
docs: clarify replacement for outdated Terms of Service URL in readme.mdPossibly taken @mohitjoshi-hey claimed this today. Open
Difficulty 1/5 1-3 hours Newbie friendliness 66/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
runkids/skillshare#530 ·
Maintainers usually reply within 1 day