Skip to content
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

Question: how to lint Svelte/Typescript files, or: can svelte-check be used with a preprossor? #121

Closed
rondonjon opened this issue May 27, 2020 · 2 comments

Comments

@rondonjon
Copy link
Contributor

rondonjon commented May 27, 2020

Luckily the VS Code plugin for svelte seems to handle my .svelte files without problems although I am using a preprocessor to handle script sections with Typescript.

I am now struggling to set up a CLI task that could do the same kind of linting inside a CI pipeline. Any ideas?

The eslint-plugin-svelte3 is no option because it doesn't yet support preprocessors.

I thought I might be able to get similar results to VS Code by running svelte-check manually, but that didn't work; I guess (if svelte-check is used at all by the plugin?) that the preprocessing is handled outside.

Piping the files through the preprocessor first doesn't seem to work either as svelte-check doesn't seem to take input from stdin.

What else could I try?

@rondonjon
Copy link
Contributor Author

rondonjon commented May 27, 2020

Sorry, found the solution myself.
I had attributed my <script> sections with lang="ts" as shown in some tutorials.
After changing the attribution to lang="typescript", svelte-check processed the files as expected.

@dummdidumm
Copy link
Member

Glad to hear that 😃

PS: Guybrush Threepwood!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants