-
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
Tsconfig.json does not resolve paths with dashes "-" in folder name #42913
Comments
This is surprising. I don't think dashes are the problem here (folders with dashes in their name work fine on other projects). Perhaps the folder name had a different type of dash (e.g. |
Agree with Mine, it's implausible that dashes are the problem here; |
Hey everyone, Thank you all for the feedback. Just found out that the errors are still happening with the name I'm still finding it weird, though. Why would Typescript care for conflicts inside This is now off-topic, but would be happy to hear your thoughts. I'll close the issue since it's not about folder names at all. This is my full
These are the errors I'm getting: |
After further research and debug, I found out that the errors were being caused by a version difference between the Since the But I still find it weird that those errors were caught by |
See also #30511 |
@cbdeveloper It's been a while since this issue was last answered. Have you found a solution? |
Bug Report
π Search Terms
tsconfig.json, path, resolve, include, exclude, dash
π Version & Regression Information
[email protected]
installed globally on VSCode Windows 10.β― Playground Link
Not necessary.
π» Code
I work with a monorepo structure and some packages are installed in more than one folder. I don't want to
skipLibCheck
, because I need my ownsrc/*.d.ts
files to be checked. But at the same time, if I allow allnode_modules
to be checked on thetsc
call, I'll get many conflicts, because a lot of library types will be declared in more than one place. So, this is what I always do:tsconfig.json
π Actual behavior
When I added the
server-jobs/node_modules
folder, I started getting conflict errors for packages insideserver-jobs/node_modules
, which made no sense, because they were supposed to be excluded.I tried tweaking my code, and experimented with some different
include/exclude
patterns. Nothing seemed to work. Until I though it could be related to the folder name, because of the dash"-"
character. Since theserver
folder wasn't triggering any errors.Then I changed it to
server_jobs
, with an underscore"_"
and everything went back to normal. No more conflict errors.I didn't find anything in the documentation for it.
https://www.typescriptlang.org/tsconfig#exclude
Is this a known issue? Is it supposed to behave like that?
π Expected behavior
I expected for the
tsc
to parse folder names with dashes"-"
without any issues, or at least for it to give me a heads up with a warning telling me that that folder name is not allowed.The text was updated successfully, but these errors were encountered: