question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow to specify the tsconfig.json filename explicitly

See original GitHub issue

currently VSCode uses the file with the exact name tsconfig.json in the folder as the project file for a typescript project,

i have a few other project files named differently for corresponding sub-projects inside the same folder, I wish there was a way to tell VSCode to use one of them rather then the default tsconfig.json

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:137
  • Comments:36 (3 by maintainers)

github_iconTop GitHub Comments

21reactions
davidmatascommented, Oct 28, 2017

I would love to see this implemented. I have problems for tests files that I think I would resolve if I can specify a tsconfig file to vscode.

The problem is my configuration for tsconfig excludes test files:

...
"exclude": [
    "node_modules",
    "**/*.test.ts",
    "**/*.test.tsx",
    "**/*.test.js"
  ]

When I open one of these files in vscode, it can’t resolve absolute paths I specify in compilerOptions:

"compilerOptions": {
...
  "paths": {
      "*": ["app/*", "*"],
  }
}

So I get a lot of ugly warnings

image

At the moment the workaround I’m using is leave tsconfig file for vscode dev development, and use differents tsconfig files for dev and production builds

19reactions
Qythyxcommented, Apr 29, 2017

I have a slightly different scenario that causes me to want this feature. My folder structure is:

MainProject/ –config/ ----bs-config.json ----tsconfig.json ----tslint.json –src/ –build/

I’m trying to put all my config files in that config folder instead of polluting the root. This works except that VSCode won’t detect my tsconfig.json in there.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TSConfig Reference - Docs on every TSConfig option
Specifies an array of filenames or patterns to include in the program. These filenames are resolved relative to the directory containing the tsconfig.json...
Read more >
Webpack ts-loader : change tsconfig filename - Stack Overflow
In Webpack 4 you need to specify the options into a use object: use: [{ loader: 'ts-loader', options: { configFile: "tsconfig.webpack.json" } }]....
Read more >
TypeScript - webpack
Let's set up a configuration to support JSX and compile TypeScript down to ES5... ... See TypeScript's documentation to learn more about tsconfig.json...
Read more >
The tsconfig.json File - Codecademy
Let's explore what the tsconfig.json file is for. ... TypeScript features are extremely useful: for one, it allows us to add types to...
Read more >
tsconfig.json - TypeScript - JavaScript that scales.
By invoking tsc with no input files and a --project (or just -p ) command line option that specifies the path of a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found