New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
svelte-check: Ignore diagnostics for imported modules #1495
Comments
I'm a little hesitant to approve this because it would deviate quite a bit from how "vanilla" TypeScript/tsc works, AFAIK you can't ignore certain files by passing a command line option. Maybe we could allow the ignore option to work for Svelte files but not TS files - but that's possibly even more confusing. If it's about TS/JS errors, you can silence them by adding a |
Thanks for the reply. So for our case, I would like to suppress the diagnostics for generated code (e.g. generated OpenAPI client stubs, which are in effect typescript modules). We use the output of svelte-check in our CI to determine the code quality. Certainly I could add (or modify the script in the CI to do it) a Beyond that, svelte-check still delivers hint diagnostics (but no more errors) for files commented with |
You can tell svelte-check to not output hints by adding To me it sounds like your use case could be worked around with these two things, so I'm hesitant to merge this feature right now, maybe sleep on it and/or await some more feedback from other people (other people: please post your use cases here!). I get your point though, this is a valid feature request! |
@cbartz what errors exactly appear in the generated code? Are you able to fix these errors or is this impractical (if yes, why)? How do other code bases (TS+X, not necessarily Svelte) deal with this, this problem must have appeared in many other places as well? |
@dummdidumm We get a |
I have reproduced it on Stackblitz. This currently makes svelte-check completely unusable for me, since I have to include a emscripten-generated file, which produces over 500 hints. In the link above, I tried:
None of which worked. |
For me, |
The same is for generated grpc-web client. Errors and warnings are suppresed, but not hints — they are still polluting all the logs. |
Description
We use svelte-check@2.2.6 and Typescript. We also use generated code in our code basis and would like to have the diagnostics for those modules ignored.
We can neither use the
--ignore
flag nor an exclude setting in thetsconfig.json
to solve this issue, because it does not work for modules who get imported by modules which are getting diagnosed.Proposed solution
Let the diagnostics for modules be ignored/suppressed, also when they get imported by a module which gets diagnosed.
So, e.g. the lines https://github.com/sveltejs/language-tools/blob/master/packages/language-server/src/plugins/PluginHost.ts#L75-L87 implement this feature hard-coded for files under
node_modules
. It would be nice if this would also work for any file specified by the--ignore
flag (or any newly-introduced flag).Alternatives
No response
Additional Information, eg. Screenshots
No response
The text was updated successfully, but these errors were encountered: