Skip to content

block-lang triggers on non-svelte files #393

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

Closed
marekdedic opened this issue Mar 6, 2023 · 2 comments · Fixed by #394
Closed

block-lang triggers on non-svelte files #393

marekdedic opened this issue Mar 6, 2023 · 2 comments · Fixed by #394

Comments

@marekdedic
Copy link
Contributor

Hi
block-lang reports plain .ts files as well, no just svelte files - kind of a false positive.

I'll try to fix it, but I am not sure how to find out whether a file is a svelte file - @ota-meshi, do you just check for file extension? I can't check for <script> or <style> blocks as they theoretically may not be present...

@ota-meshi
Copy link
Member

Thank you for your bug report.

I think we might get around the problem by adding a guard like this:

     if (!context.parserServices.isSvelte) {
       return {}
     }

https://github.com/ota-meshi/eslint-plugin-svelte/blob/97b46c70c0463850a9a9596fe372f422ec793d68/src/rules/valid-compile.ts#L25

@marekdedic
Copy link
Contributor Author

marekdedic commented Mar 6, 2023

Thanks, I'll make a PR :)

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

Successfully merging a pull request may close this issue.

2 participants