dominikg / tsconfck

A utility to find and parse tsconfig files without depending on typescript
Other
290 stars 14 forks source link

parse does not work with ${configDir} variable of tsconfig.json in node_modules #188

Closed Zamiell closed 3 weeks ago

Zamiell commented 1 month ago

steps to reproduce:

git clone git@github.com:IsaacScript/isaacscript.git
cd isaacscript
git checkout 939662fcb5d5efc37a80b2cf8e5f7f4e23986c9e
yarn
cd packages/eslint-plugin-isaacscript
npm run build
# The build will succeed.
# Now, we change "tsconfck.parseNative" to "tsconfck.parse".
sed --in-place 's/tsconfck\.parseNative/tsconfck.parse/g' ../isaacscript-common-node/src/functions/scriptHelpers.ts
npm run build
# The build fails.
dominikg commented 1 month ago

please provide a link to a minimal reproduction, not a huge monorepo.

Zamiell commented 1 month ago

Sorry, I don't currently have the cycles to provide a minimal reproduction. For now, I will use parseNative, and I guess we can leave this issue open to see if anyone else has the same problem.

Zamiell commented 3 weeks ago

I think I narrowed down the bug. It seems that tsconfck does not parse npm packages correctly, as demonstrated by the following reprex: https://github.com/Zamiell/test

If you copy paste the remote tsconfig and put it in the repo root, then everything works fine. Thus, I guess the logic for resolving npm packages isn't working properly?

dominikg commented 3 weeks ago

please check #189 and lmk if that works for you. I did add a testcase based on your config so it really should ;) Thanks for the reproduction

Zamiell commented 3 weeks ago

thanks, that does seem to fix the problem!

dominikg commented 3 weeks ago

fix released in 3.1.2