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

What's the trick to getting eslint to work with svelte files? #11

Open
groovy9 opened this issue Jul 5, 2020 · 3 comments
Open

What's the trick to getting eslint to work with svelte files? #11

groovy9 opened this issue Jul 5, 2020 · 3 comments

Comments

@groovy9
Copy link

groovy9 commented Jul 5, 2020

I have coc intellisense working fine in svelte files, and coc eslint working fine in .js files, but no eslint in svelte files. Is this known to work? If so, what configuration is necessary?

I have no coc-specific stuff in my init.vim other than loading the coc plugin and having :CocInstall'd coc-svelte, coc-eslint and
coc-tserver. I'm loading evanleck/vim-svelte and setting filetype to svelte. Here's my eslintrc.json:

{ "env": { "browser": true, "es6": true }, "parser": "babel-eslint", "parserOptions": { "ecmaVersion": 2019, "sourceType": "module" }, "plugins": ["svelte3"], "extends": ["eslint:recommended"], "overrides": [ { "files": ["**/*.svelte"], "processor": "svelte3/svelte3" } ], "rules": { "indent": ["error", 2], "semi": ["error", "never"], "quotes": ["error", "single"] } }

@iamcco
Copy link
Member

iamcco commented Jul 5, 2020

There is no eslint support by this extension.

@Jayphen
Copy link

Jayphen commented Aug 18, 2020

This is old, but @groovy9 maybe this will help:

I have the following in coc-settings.json:

  "eslint.filetypes": ["javascript", "typescript", "svelte"],
  "coc.preferences.formatOnSaveFiletypes": [
    "javascript",
    "typescript",
    "typescriptreact",
    "json",
    "javascriptreact",
    "typescript.tsx",
    "graphql",
    "svelte"
  ]

Eslint works fine for me in .svelte files.

@Gelio
Copy link

Gelio commented Mar 28, 2021

At the time of writing, I am using the following coc-settings.json to get ESLint to work:

{
	"eslint.probe": [
		"javascript",
		"javascriptreact",
		"typescript",
		"typescriptreact",
		"html",
		"vue",
		"markdown",
		"svelte"
	],
	"eslint.options": {
		"ignorePath": ".gitignore"
	},
	"eslint.lintTask.options": ["--ignore-path", ".gitignore", "."],
	"eslint.validate": ["svelte"]
}

The most important item is eslint.validate. You probably also want eslint.validate.

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

4 participants