-
Notifications
You must be signed in to change notification settings - Fork 43
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
VS Code integration, and playing nice with the svelte-vscode plugin #50
Comments
There's a note on the page you linked to:
Should this be made more prominent? Using |
I had to put this configuration in order to let eslint format my svelte js code: "svelte.plugin.svelte.format.enable": false |
I seem to be running into the same issue, but @lud 's fix didn't work for me. ESLint Version: 6.8.0 *.eslint.js` module.exports = {
parserOptions: {
ecmaVersion: 2019,
sourceType: 'module'
},
env: {
es6: true,
browser: true
},
plugins: [
'svelte3'
],
overrides: [
{
files: ['**/*.svelte'],
processor: 'svelte3/svelte3'
}
],
rules: {
// ...
},
settings: {
// ...
}
}; The error I get from my ESLint channel output is the following
|
I am getting the exact same issues as @jhechtf Running on a windows 10 machine, I tried everything and I keep getting said override error |
@jhechtf Hey I think I may have found a solution, for me I was working in a nested folder, in vscode I changed this in my
This caused all the errors to go away |
Update 05/09/2020: this is what I needed...
|
I had eslint working in svelte files from CLI, but not in VSC (so not auto-save fix goodies). I can confirm @richardeschloss solution works. |
To get eslint to lint .svelte files in vscode I had to modify eslint.validate option to include "svelte". The modification to .eslintrc is probably unnecessary but i'm too scared to revert it :P See Also: sveltejs/eslint-plugin-svelte3#50 (comment)
Closing as this is now also explained at https://github.com/sveltejs/eslint-plugin-svelte3/blob/master/INTEGRATIONS.md#visual-studio-code |
Thanks @Bellarmine-Head ! I had to add this to my
|
This was a life saver, thank you. It was doing the changes then immediately undoing them until I put this in. |
FWIW,
Here is a set up for VS Code as of December 2019 that works nicely for me wrt
eslint-plugin-svelte3
.My
package.json
contains this:-My VS Code's
settings.json
contains this:-My
.eslintrc.json
file contains this:-I have James Birtles's Svelte VSCode plugin installed. Its
.prettierrc
file in my project (at the same folder level as the.eslintrc.json
file) contains this:-so that I can format .svelte files and have
<!-- comments -->
at the top of document.I have found that wrt https://github.com/sveltejs/eslint-plugin-svelte3/blob/master/INTEGRATIONS.md#visual-studio-code
a) I did not need nor want:-
and
b) the following is invalid syntax in VSCode's
settings.json
:-and all I actually needed was:-
(I left out "javascriptreact" because I do Svelte and not React 😄 )
The text was updated successfully, but these errors were encountered: