vscode_deno: Linting in VS Code not working when using enableProjectDiagnostics

I set up a simple deno project with only this file. But the linting is messed up. It looks like the default TypeScript language server is still parsing this file, even though I have installed the extension.

import { cron } from 'https://deno.land/x/deno_cron@v1.0.0/cron.ts';
import { config } from 'https://deno.land/x/dotenv@v2.0.0/mod.ts';

console.log('cron initiated: ', new Date());

cron('*/5 * * * *', async () => {
  await fetch("bla")
});

My workspace settings:

{
  "deno.lint": true,
  "deno.unstable": true,
  "deno.enable": true
}

Bildschirmfoto 2021-12-10 um 11 33 20 Bildschirmfoto 2021-12-10 um 11 32 20 Bildschirmfoto 2021-12-10 um 11 32 51

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 33 (15 by maintainers)

Most upvoted comments

Enabling project diagnostics for the built in TypeScript server does not enable the same feature for the Deno language server. If there is a desire for the same feature in the Deno language server, that would be a separate request.

This issue only covers the situation where someone has it enabled globally for the built in TypeScript language server, but has enabled Deno for a specifoc workspace. Currently the only workaround would be to disable the feature in the workspace, as it breaks the suppression mechanism of the Deno vscode extension.

@Namekkural If you want the errors to disappear you have to make sure that both:

  • typescript.tsserver.experimental.enableProjectDiagnostics is set to false
  • and your project doesn’t contain any jsconfig.json files.

The Deno.enable setting doesn’t belong in your jsconfig.json file, but rather in .vscode/settings.json. Or you can globally disable project diagnostics from the vscode settings screen.

Do you have project diagnostics enabled? (typescript.tsserver.experimental.enableProjectDiagnostics) That also seems to trigger it for me.