Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Read compilerOptions from tsconfig in cwd #49

@temapavloff

Description

@temapavloff

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:

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions