Closed frederikhors closed 5 years ago
I'm using this .eslintrc.js
:
module.exports = {
root: true,
parserOptions: {
ecmaVersion: 2019,
sourceType: 'module'
},
env: {
es6: true,
browser: true,
node: true
},
extends: [
'eslint:recommended',
'standard'
],
plugins: ['svelte3'],
overrides: [
{
files: '*.svelte',
processor: 'svelte3/svelte3'
}
]
}
I'll need a .svelte file that this happens with as well.
Yes, I now. I'm trying to create a reproducible gist.
Ok I have one example (different from mine, but something strange is happening here too).
From https://github.com/timhall/svelte-apollo:
<script>
import { getClient, query } from 'svelte-apollo';
import { GET_BOOKS } from './queries';
const client = getClient();
const books = query(client, { query: GET_BOOKS });
</script>
{#await $books}
Loading...
{:then result}
{#each result.data.books as book}
{book.title} by {book.author.name}
{/each}
{:catch error}
Error: {error}
{/await}
If you try with: npx eslint --fix .\src\fileName.svelte
the error is:
1:26 error Unexpected token ParseError
During saving it creates a new line let $books;
.
Ok. I'm using just eslint-plugin-import
.
If you're using them on other linted files, consider adding overrides for them for Svelte components.
How to do this?
It works. Thanks!
Sometimes in a .svelte file with many imports using cli (or VSCode) it changes the first
import
inimimport
orimpimport
.