-
Notifications
You must be signed in to change notification settings - Fork 44
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
Multiple empty lines error when there are none in <script> tags #41
Comments
I am facing the same issue. The latest update of I am trying to corner the problem... so this tiny snippet: <script>
let a = 1;
</script> is processed by {
transformed_code: '\n\nlet a = 1;\n\n',
} @Conduitry Maybe we can
|
I had the same problem with the airbnb rules. In the end I just defined a custom
|
If you use Prettier, you can silence this with |
* build: add eslint,standard,prettier libs * build: add config files for eslint/prettier * fix(eslint): issue with svelte plugin sveltejs/eslint-plugin-svelte3#41 * build: add hysky and lint staged with pre-push hook
I have used something like this to get around it:
Note that you cannot use |
I still seem to get this problem as of May 2022 with the combination of this package, the eslint typescript packages, and standard. I believe that standard is actually the 'problem', as removing it seems to make it go away, but I have a feeling they may just say the issue is on this packages end. Is there any clues as to why this is happening @Conduitry ? I can provide a reproduce able example if you need it. |
I am also seeing this, even when using the fix mentioned in this issue. I've included a code snippet and screenshot of when I see it. I don't have much idea on how the linter works here, but I took a quick look at the package's code. When there are multiple script blocks in a template, it looks like there's an "extra" Using the example below, I found that if the I am still trying to figure out why all those new lines get added in Example: <script context="module" lang="ts">
export const prerender = true;
</script>
<script lang="ts">
console.log("foo");
</script> |
I'm not sure if this is actually a
eslint-plugin-svelte3
problem or just a generaleslint
orbabel-eslint
problem, but it's happening in.svelte
files so I thought I'd share it here.I've installed eslint and extend the "standard" rule set, and then on top of that I've installed this plugin for Svelte 3.
In a
.svelte
file if I use both a<script context="module">
tag and a normal<script>
tag in the same file I get the following lint error:When I remove one of the script blocks the error goes away. It also goes away if I move the ending
</script>
tag onto the end of the last line of JS in thecontext="module"
tags.For example:
This will produce the multiple empty lines error at the beginning of the
</script> tag after
['bar']`.If I change it to this:
The error goes away.
This is my
.eslintrc.js
file:I don't think I've set anything up incorrectly, and so far I've only seen the problem in
.svelte
files.The text was updated successfully, but these errors were encountered: