smeijer / unimported

Find and fix dangling files and unused dependencies in your JavaScript projects.
MIT License
1.97k stars 71 forks source link

feat: Specify cwd to read tsconfig #174

Closed richardaum closed 1 year ago

richardaum commented 1 year ago

Considering NX integrated monorepo, each app has its own tsconfig.json file. Also, a tsconfig.json also could be located at the root dir.

Currently, this project always read cwd from process.cwd() which is the root dir, which leads to reading the wrong tsconfig file.

This pull request changes the code to allow specifiying a cwd argument to the readTsconfig function. The cwd comes from the getAliases cwd argument.