-
-
Notifications
You must be signed in to change notification settings - Fork 198
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
Config file for svelte-check #2559
Comments
As for |
Ok, so what I understand is that ESLint does not use the
The other options of svelte-check are not relevant to other tools and it would thus not make sense to be put into a shared config file. This would still not exactly be a replacement to what I suggested since So, if I got it all correct, I guess I'll ask the eslint-plugin-svelte team to consider evaluating the |
I opened sveltejs/eslint-plugin-svelte#905 |
Description
Svelte check offers a few settings like settings a tsconfig file or ignoring error messages. Currently it is only possible to set those using the command line switches.
I suggest that svelte-check also looks for a config file in the workspace root for the following reason:
svelte-check is run by several tools, i.e. on the VSCode extension and the language server or ESlint when using the
svelte/valid-compile
rules. In addition, people use svelte-check in CI/CD workflows and run it manually using npx/npm or via scripts in the package.json.If I would like certain warnings to always be disabled, I have to configure each tool individually -- this causes quite some overhead and sometimes is not even possible (i.e. ESlint's rule does not provide a way to ignore only some warnings, but only either ignore everything or nothing).
Proposed solution
I suggest that svelte-check also looks for a file, let's say
svelte-check.config.json
or maybe a setting insvelte.config.[cjs|mjs|ts]
that makes it possible to enable certain commonly used settings.something like this would work:
The schema could follow the schema from the
sv
CLI tool and we could load the before any manually passed config options are evaluated so that those take priority for backwards compatibility.Loading order would be: default values --> load file if present --> overwrite with options manually passed to svelte-check.
Alternatives
Maybe we could make the most important settings available through ENV variables like so:
Additional Information, eg. Screenshots
Just to outline the extend of the issue in a simple case:
To disable a single warning, you currently would do this:
svelte.config.js
package.json
>scripts
>check
to include--compiler-warnings "foo:ignore,bar:ignore"
sv check
manually, to also add all your rules:--compiler-warnings "foo:ignore,bar:ignore"
The text was updated successfully, but these errors were encountered: