-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jsconfig Not Picked Up When tsconfig is Present #15869
Comments
That is actually by design. tsconfig.json is always given preference, and if it is not applicable it is skipped. i would like to get more user input on this before making a decision whether to change the current design or not. |
Thanks @mhegazy. Can you take a look at microsoft/vscode#26550 (comment) and see if there are other ways to address the issue @Triplesnail was running into |
@mhegazy I use different compilers for JS and TS so it's pretty frustrating that I can't specify the compiler options separately. |
I have a large project written in Javascript that we want to migrate to TypeScript. The process will be slow and take a long time but meantime all import aliases are broken on javascript for this reason. It'd be nice if VSCode would implement aliases on both file types or at least fallback to |
I have a mixed JS/TS codebase, and I need to specify a My first thought was to have a both a |
Ya VSCode will ignore jsconfig.json when tsconfig.json is present. The way to make paths resolution (or aliases) work is to simply set |
Same here. I use tsconfig because it's a TypeScript project. But also have Node scripts in JavaScript and want the "checkJs" feature. In subfolder "tools", it works. But I also have some js-files in root. I think both files can work since one config file is for ts-files and the other one for js-files. ... I don't want tsconfig allowJs. It's a different setup. 🤔 |
If both It's only logical that you'd want a source TS project parallel and separate from the target compiled JS project. Having If possible, ideally, it could even go as far as allowing e.g.: |
Without necessarily addressing the current status of this issue, the workaround I'd suggest is to create both a // tsconfig.json
{
// Include no files for a "solution-style" config.
"files": [],
"references": [
{ "path": "./tsconfig.ts.json" },
{ "path": "./tsconfig.js.json" },
]
} |
I 100% agree. I was just bit by this when trying to start adding ts into a legacy js project. Everything seemed to be going smoothly right up until I realized my intellisense and "jump to source" broke for the subpath imports in the .js files. The tsconfig file is tightly scoped to the new ts files (via What I would expect to happen in that situation is that the tsconfig is applied first, and any remaining files not
What I would find much more intuitive is
This way the tsconfig is always preferred, but the jsconfig is still respected on the files the tsconfig doesn't cover. |
This should be fixed by #57196 |
From: microsoft/vscode#26550
TypeScript Version: 2.3.3
Repo
Create a folder that contains both a
tsconfig.json
for ts files and ajsconfig.json
for js filesExpected behavior:
Both projects are picked up
Actual behavior:
Only the TSConfig is picked up
The text was updated successfully, but these errors were encountered: