frigjord
frigjordā€¢2y ago

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
AapoAlas
AapoAlasā€¢2y ago
In .vscode/settings.json you can set "deno.lint": false I believe.
frigjord
frigjordā€¢2y ago
I tried that, it did nothing
AapoAlas
AapoAlasā€¢2y ago
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:
AapoAlas
AapoAlasā€¢2y ago
AapoAlas
AapoAlasā€¢2y ago
And I no longer have the deno lint warning.
AapoAlas
AapoAlasā€¢2y ago
ie. It does seem to do something. Maybe try forcing the Deno LSP to restart using the Deno: Restart Language Server command.
frigjord
frigjordā€¢2y ago
frigjord
frigjordā€¢2y ago
frigjord
frigjordā€¢2y ago
I added it in .vscode/settings.json Restarting deno lang server or vscode didn't help Also upgraded vscode Also reloaded window as someone suggested
AapoAlas
AapoAlasā€¢2y ago
That'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.
AapoAlas
AapoAlasā€¢2y ago
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:
frigjord
frigjordā€¢2y ago
It got disabled if i opened only that specific project folder but not in a workspace with multiple projects
AapoAlas
AapoAlasā€¢2y ago
@frigjord And the reason why I say
Presumably you have the Deno language extension enabled globally
is due to "deno.enable": true not being in that settings.json. Ah, then you might have it defined in the workspace settings.
AapoAlas
AapoAlasā€¢2y ago
frigjord
frigjordā€¢2y ago
I disabled it globally, but still shows
AapoAlas
AapoAlasā€¢2y ago
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,
frigjord
frigjordā€¢2y ago
enablePaths is empty in both default and ws settings
AapoAlas
AapoAlasā€¢2y ago
And deno.enable also set to false?
frigjord
frigjordā€¢2y ago
Yes
AapoAlas
AapoAlasā€¢2y ago
And did you check user settings as well?
AapoAlas
AapoAlasā€¢2y ago
AapoAlas
AapoAlasā€¢2y ago
Also just to check, what's your deno --version?
frigjord
frigjordā€¢2y ago
Latest deno, vscode settings.json has deno.lint false