Open stabpd opened 1 week ago
I don't know if anyone is really putting absolute paths in their config files; this seems like a nonstandard usage. showConfig
is intended for human consumption so it's not really wrong for it to do different things given different inputs. Not sure what the "best" behavior is but if someone really needs to change it to some provably better outcome, they can.
I agree that this is not an urgent matter. Let me add a little clarification for future discussion though:
For me, it's not about manually configured absolute paths, but about ${configDir}
which has the same issue, because the template variable gets substituted with absolute paths internally.
When switching from a monolithic config to a base tsconfig.json
that I could extend, I wanted to verify changes via showConfig
. Seeing no files
there, no matter what I did, almost made me discard using that nice new ${configDir}
feature.
I can live with the current behaviour, now that I know. But maybe this will confuse other users as well, leading them down the wrong path too.
π Search Terms
"--showConfig", "include", "configDir", "files", "extends", "absolute"
π Version & Regression Information
3.2.1
(--showConfig
was introduced here)3.2.4
5.5.2
(${configDir}
was introduced here)latest
=>5.6.3
next
=>5.7.0-dev.20241011
--showConfig
cli flag was introduced in TS 3.2 andconfigDir
template variable was introduced in TS 5.5.β― Playground Link
No response
π» Code
π Actual behavior
β Printing config yields different results.
files
property is missing.${configDir}
is resolved to and behaves / fails the same as absolute paths.β Listing files yields the same output.
List of files printed to stdout, containing
/path/to/
src/index.ts
/path/to/
`node_modules//*.d.ts`** entries from npm dependency type declarations./path/to/
node_modules/typescript/lib/lib.decorators.d.ts
(only in TS 5 of course)/path/to/
node_modules/typescript/lib/lib.decorators.legacy.d.ts
(only in TS 5 of course)β Building yields the same
index.js
file content for all configs.π Expected behavior
--showConfig
should show the samefiles
for configs that build the same files and show the same listing for--listFiles
.Additional information about the issue
includeRe
inmatchesSpecs
seems to be calculated differently for absolute / relative paths, resulting in all files being filtered out inconvertToTSConfig
.I can't tell though which behaviour is actually expected. (keep files or filter files out?)