Read compilerOptions from tsconfig in cwd
- Dominant language
- TypeScript
- Stars
- 1.2k
- Forks
- 18
- PR merge metrics
- No merged PRs in 30d
Description
Hi Luke!
We use tsm with uvu in our new project. I really like how fast our test are with them.
I'm wondering about why tsm doesn't use all the `compilerOptions` listed in `tsconfig.json` from the current working directory.
We have `"jsx": "react-jsx"` option in our `tsconfig.json` which is not the default and we had to add the following code into `tsm.js` file to make it work in tests:
```JavaScript
const tsConfig = require('./tsconfig.json');
const tsconfigRaw = {
compilerOptions: tsConfig.compilerOptions,
};
module.exports = {
common: {
tsconfigRaw,
},
};
```
It works, but it's a bit less convenient then if tsm could automatically read the compiler options from tsconfig.
What do use think about automatically reading tsconfig if it exists in the project?
Thank you!
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reviewing tsm.js and how its compiler options are currently configured. Check how the uvu test setup uses the project's tsconfig.json, then verify that compilerOptions from tsconfig.json in the current working directory are applied, including the non-default jsx setting.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100