How to disable deno linter for whole project directory?
I'm using deno with mixed project folders, some use Vue and shouldn't be linted by deno. How do i disable it for the project folder?
23 Replies
In
.vscode/settings.json
you can set "deno.lint": false
I believe.I tried that, it did nothing
Now I set
deno.lint
to false. When I press save in the settings.json
I can see some editors flashing so it's obviously reloading stuff:And I no longer have the deno lint warning.
ie. It does seem to do something. Maybe try forcing the Deno LSP to restart using the
Deno: Restart Language Server
command.I added it in
.vscode/settings.json
Restarting deno lang server or vscode didn't help
Also upgraded vscode
Also reloaded window as someone suggestedThat's not Deno's linting but the importing (ie. not a "don't do this, this may be bad code" but Deno itself saying "this will not work, it will throw an error in runtime"). Presumably you have the Deno language extension enabled globally, but in this case you only want to apply it selectively. Try adding the
"deno.enablePaths": [...]
setting to control where you use the Deno LSP and where normal TypeScript LSP should be used.eg. I just used
enablePaths
to set only "lib"
to be used by Deno. Now in my test/some.test.ts
file I have this error:It got disabled if i opened only that specific project folder
but not in a workspace with multiple projects
@frigjord And the reason why I say
Presumably you have the Deno language extension enabled globallyis due to
"deno.enable": true
not being in that settings.json.
Ah, then you might have it defined in the workspace settings.I disabled it globally, but still shows
Then you might also have it turned on both globally and in the workspace settings 😄
There's "Open default settings (JSON)" and "Open user settings (JSON)" which can contain the same stuff.
I just tested and indeed if you open the workspace settings JSON then it should (or can) contain a
settings
key which then can contain "deno.enabled": true
and "deno.enablePaths: [...]
. The paths is a bit annoying to use: It doesn't seem to understand "plain paths" eg. "dev/denostuff/libA" even though the folders definition for workspaces works this way. It also doesn't seem to understand relative paths from the workspace file. It does understand "plain paths" that it solves for each workspace folder individually, so eg. modules/foo
would work to enable Deno in both libA/modules/foo
and libB/modules/foo
.
It also works for absolute paths, so /home/user/dev/dev/denostuff/libA/modules/Foo
will works.
deno.enablePaths
also comments that:
// When a value is set, the value of "deno.enable"
is ignored.
So if you have an enable path that matches your current path, then even if you turn deno.enable
off this will still override that apparently.
// Controls if the Deno Language Server is enabled. When enabled, the extension will disable the built-in VSCode JavaScript and TypeScript language services, and will use the Deno Language Server instead.
//
// If you want to enable only part of your workspace folder, consider using deno.enablePaths
setting instead.
//
// Not recommended to be enabled globally.
"deno.enable": false,
enablePaths is empty in both default and ws settings
And
deno.enable
also set to false
?Yes
And did you check user settings as well?
Also just to check, what's your
deno --version
?Latest deno, vscode settings.json has deno.lint false