D
Deno

help

How to disable deno linter for whole project directory?

Ffrigjord1/23/2023
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?
AAapoAlas1/23/2023
In .vscode/settings.json you can set "deno.lint": false I believe.
Ffrigjord1/23/2023
I tried that, it did nothing
AAapoAlas1/23/2023
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:
AAapoAlas1/23/2023
AAapoAlas1/23/2023
And I no longer have the deno lint warning.
AAapoAlas1/23/2023
ie. It does seem to do something. Maybe try forcing the Deno LSP to restart using the Deno: Restart Language Server command.
Ffrigjord1/23/2023
Ffrigjord1/23/2023
Ffrigjord1/23/2023
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
AAapoAlas1/23/2023
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.
AAapoAlas1/23/2023
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:
Ffrigjord1/23/2023
It got disabled if i opened only that specific project folder but not in a workspace with multiple projects
AAapoAlas1/23/2023
@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.
AAapoAlas1/23/2023
Ffrigjord1/23/2023
I disabled it globally, but still shows
AAapoAlas1/23/2023
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,
Ffrigjord1/23/2023
enablePaths is empty in both default and ws settings
AAapoAlas1/23/2023
And deno.enable also set to false?
Ffrigjord1/23/2023
Yes
AAapoAlas1/23/2023
And did you check user settings as well?
AAapoAlas1/23/2023
AAapoAlas1/23/2023
Also just to check, what's your deno --version?
Ffrigjord1/23/2023
Latest deno, vscode settings.json has deno.lint false

Looking for more? Join the community!

Recommended Posts
How can I get `npm` in the path for Deno.run()?I'm writing a script to automate a tedious npm task that I run frequently. When I use `Deno.run()` iUse Deno.run() to communicate with ArduinoHey I'm trying to communicate via USB serial with my Arduino. My goal is to have the result I get viBest place to host server side Deno AppI have a server side app I want to host in a specific region and I only want 1 instance of it runninNPM Import missing typesPlaying around with some deno code and testing a npm import, the original package has types (redaxioUpdate value by reference without duplicating the dataIm exploring the world of FFI, porting some C applications I have to TypeScript, with the help of Dehow to hash very large filesWe have deprecated the old std/hash code in favor of the crypto module, but I do not know what the sxstate - no types importedimport * as xstate from "https://deno.land/x/xstate@xstate@4.35.2/src/index.ts"; file is cached, yetexample of kysely running on deno deploy?Deno Deploy awesomely can connect to postgres directly from the edge https://deno.com/blog/deploy-poUpdating digest with web cryptoFor some context, I'm updating some code that was importing from `std/hash` (specifically `std/hash/What would be the best third party module implementing `deflate()`?Currently using `npm:pako` but I'd like to avoid npm specifiers (modules in general).Pass string to struct FFIQuick question about Struct-Value feature, what would be the best way to pass `*const u8` (or stringdeno blog without html sanitizationI want to be able to javascript Canvas API things in my blog - surely this is possible?Killing subprocess not workingAnyone know what I'm doing wrong when trying to kill a process? I have a process start another procPossible to check of a file is being run as worker?```ts if (import.meta.main) { main() } ``` is there a way to disable calling `main()` if the file Deno linter is telling me that writeAll from streams conversion is deprecatedIs import { writeAll } from "https://deno.land/std@0.171.0/streams/conversion.ts" deprecated?How to get Deno's default compilerOptions value?I want to add more compilerOptions.lib options like this: ``` "compilerOptions": { "jsx": "rea