DenoDDeno
Powered by
VinceAggrippinoV
Denoβ€’3y agoβ€’
2 replies
VinceAggrippino

Can I disable deno linting for individual files, or a path?

I'm using VSCode and the Deno extension. I want to use the inbuilt functionality of VSCode for type checking client-side JavaScript (in
/website/js
/website/js
for this project) and Deno's type checking for other TypeScript files.

I like what I'm doing with TypeScript and I'd like a similar experience with regular JS. So I did some reading about JSDoc and type-safe JS, but when I tried to set it up with a
tsconfig.json
tsconfig.json
file, it didn't do anything. If I add
// @ts-check
// @ts-check
to the top of the JS files I want to check, I get incorrect error messages from
deno-ts
deno-ts
.

In the screenshot, for example, it doesn't know what
document
document
is and it's just fine with identifying the type of the
ui
ui
variable as
String
String
when it should be
Element
Element
. It recommends adding something like
"lib": ["DOM"]
"lib": ["DOM"]
to
compilerOptions
compilerOptions
in the config, but I tried that and it's pretty clear that nothing it's not reading
tsconfig.json
tsconfig.json
.

Cannot find name 'document'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'.

Then I disabled the Deno extension and everything works like I've read that it should and the errors, generated by
ts
ts
, all make sense.

With the Deno extension enabled, but no
// @ts-check
// @ts-check
at the top of the file, there are no error messages. So, Deno's not checking it but it's preventing
ts
ts
from checking it, too.
image.png
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,944Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Can I disable type checking for specific files or folders?
MoomooMMoomoo / help
4y ago
How can I get `npm` in the path for Deno.run()?
ztraeshuxjmvZztraeshuxjmv / help
4y ago