question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is ignoring errors supported in VS code/svelte-check?

See original GitHub issue

I have an expected error that I’d like the language server & svelte-check to ignore. I have if (import.meta.env.NODE_ENV === "development") where import.meta.env.NODE_ENV is replaced at build time by Vite.

I couldn’t find how to ignore errors documented anywhere. If it’s not supported, consider this a feature request. It’d nice to be able to use something like // @svelte-ignore.

For my use-case, I could easily create a svelte.config.js, and use rollup-plugin-replace to help the language server out. The severity of this low. It’s just more a bit more convenient.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
dummdidummcommented, Sep 2, 2020

VS Code:

svelte-check:

  • You can choose to ignore certain Svelte compiler warnings
  • You can use //@ts-ignore to silence single errors
  • You can use //@ts-nocheck to silence a whole file

For your specific case, do

  // @ts-ignore
  if (import.meta.env.NODE_ENV === "development") {
     ...
  }
0reactions
jacobmischkacommented, Jun 17, 2021

I see. Is there a workaround you can think of?

Aside from @ts-nochecking the whole file, and aside from just fixing the error, of course.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ignoring Errors with Flake8 — flake8 3.1.1 documentation
This tells Flake8 to ignore any error codes starting with E1 , E23 , or W503 while it is running. Note. The documentation...
Read more >
Manage errors in APM: Collect, ignore, or mark as expected
Go to the Server-side configuration menu for the application that has errors that you want to ignore. Under Error collection, look for Ignore...
Read more >
Ignoring Errors - TrackJS Docs
Errors Ignored by a rule are removed before your account is subject to throttling limits, so it's a good idea to ignore unactionable...
Read more >
Ignoring Errors - PHPStan
To ignore errors by a regular expression only in a specific file, add an entry with message or messages and path or paths...
Read more >
How to: Ignore Errors in Tasks - MSBuild | Microsoft Learn
Learn how to ignore errors in MSBuild tasks, and control whether a build stops or continues when a task failure occurs.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found