question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

vscode: using rules and config from .eslintrc.js

See original GitHub issue

I have

{
  "extends": "standard"
}

(which comes from https://github.com/standard/eslint-config-standard#usage) in my .eslintrc.js and I’m wondering why this doesn’t work in <script></script> part of my .svelte files.

What rules is this plugin following?

UPDATE:

Reproduction project: https://github.com/frederikhors/svelte3-vscode-eslint

Using this in command line: npx eslint --fix .\src\* works good, it changes App.svelte and main.js as I want: following standard.js rules.


From https://github.com/UnwrittenFun/svelte-vscode/issues/56.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
ortacommented, May 7, 2020

I’m not sure this extension should be touching things related to eslint - I’m assuming that in this case @frederikhors want a way to disable formatting to allow eslint to own that. We have the setting, but not really the docs:

             "svelte.plugin.svelte.format.enable": {
                    "type": "boolean",
                    "default": true,
                    "title": "Svelte: Format",
                    "description": "Enable formatting for Svelte (includes css & js)"
                }
1reaction
jasonlyu123commented, May 7, 2020

You can set up eslint-plugin-svelte3 in your project. And use eslint extension. This works for me.

If you mean format. This plugin uses prettier, as far as I know, prettier doesn’t pick up eslint’s config, you would have to disable this plugin’s format and use eslint to format.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ESLint + VSCode: How to Format Your Code Using .eslintrc
Open up VSCode's settings. On a Mac, press Cmd+, or get there through the menus: Code > Preferences > Settings. It'll open the...
Read more >
VS Code ESLint extension - Visual Studio Marketplace
eslintrc configuration file. You can do this by either using the VS Code command Create ESLint configuration or by running the eslint command...
Read more >
How To Lint and Format Code with ESLint in Visual Studio Code
To find the settings in Visual Studio Code, use the command palette to open Preferences: Open Workspace Settings (JSON). With this code in...
Read more >
How to use ESLint in VSCode - Robin Wieruch
ESLint supports you and teams to follow a common code style in your project. It can be used in VS Code by installing...
Read more >
Setting up ESLINT in your JavaScript Project with VS Code
create a javascript project · install eslint as an extension in your VS Code Editor · Install eslint as a global package using...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found