ts errors in js files
See original GitHub issueInitially, I filed this error with VSCode: https://github.com/microsoft/vscode/issues/102320#issuecomment-659692891
I suspected VSCode because it was just updated, yet I installed Deno at the same time. It turned out that it is clearly related to the Deno extension. See below.
As soon as I upgraded to 1.47 all my purely JS projects started to show TS errors. I don’t have TS on my system, nor jsconfig
or tsconfig
, yet even trivial code produces errors. Before 1.47 it was totally usable for JS/ES projects.
Example of an error to illustrate what I am talking about:
const identity = x => x;
In this example x
is highlighted with a red squiggly line showing this error:
(parameter) x: any
Parameter 'x' implicitly has an 'any' type.ts (7006)
Peek Problem (⌥F8) No quick fixes available
Why is it an error? I don’t want to fix it.
Obviously, if I try to add a type annotation, it errors showing:
Type annotations can only be used in TypeScript files.ts (8010)
Peek Problem (⌥F8) No quick fixes available
Which is totally fair. At least we know that it understands that this file is not TS.
Why it is bad and makes my life hell:
- In the minimap it shows bright red on every line preventing overviewing searches and so on.
- In the file view (Explorer) all open files are red. I use colors for modified and newly added files. Now I don’t know the git status until I close files.
- I don’t like seeing errors where there are no errors. 😃
This is my settings.json
just to see that it doesn’t have any funny business:
Click me to expand:
{
"gitlens.advanced.messages": {
"suppressShowKeyBindingsNotice": true
},
"editor.fontLigatures": true,
"editor.fontFamily": "Fira Code",
"sync.gist": "0aadafae52deaff8d740ba461b9349c9",
"sync.quietSync": false,
"sync.removeExtensions": true,
"sync.syncExtensions": true,
"sync.autoDownload": false,
"sync.autoUpload": false,
"sync.forceDownload": false,
"window.zoomLevel": 1,
"breadcrumbs.enabled": true,
"cSpell.enabledLanguageIds": [
"asciidoc",
"c",
"cpp",
"csharp",
"css",
"go",
"handlebars",
"html",
"jade",
"javascript",
"javascriptreact",
"json",
"latex",
"less",
"markdown",
"php",
"plaintext",
"pub",
"python",
"restructuredtext",
"rust",
"scss",
"shellscript",
"text",
"typescript",
"typescriptreact",
"yml"
],
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.largeFileOptimizations": false,
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"git.autofetch": true,
"todo-tree.tree.showScanModeButton": false,
"javascript.suggest.autoImports": false,
"typescript.suggest.autoImports": false,
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"search.searchEditor.reusePriorSearchConfiguration": true,
"search.actionsPosition": "right",
"editor.minimap.enabled": true
}
There is a project-specific setting.json
:
Click me to expand:
{
"deno.enable": false
}
Please tell me how I can help you guys to fix this problem.
As you can see in my project settings I have Deno disabled: "deno.enable": false
, yet the problem is present as long as the extension is enabled in VSCode. When I disable it and restart the problem is gone. Clearly it proves that the Deno extension is the culprit.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:8 (4 by maintainers)
Top GitHub Comments
This has been resolved in version 3.x of the extension.
I can confirm disabling Deno extension resolves this issue.