Home > other >  VSCode ESLint custom format javascript rules
VSCode ESLint custom format javascript rules

Time:12-26

enter image description here

I want to use single quotes, no semicolon, I use ESLint & Prettier - Code formatter extensions, I don't know how to configure ESLint in settings.json, can anyone help me, much appreciate.

CodePudding user response:

If you are using both ESLint and Prettier, then you should configure only Prettier for the formatting since he will disable ESLint rules that affect formatting. You can create .prettier.json file in the root of your project and add this config:

{
  "singleQuote": true,
  "semi": false
}

CodePudding user response:

This link should be able to guide you: https://eslint.org/docs/user-guide/configuring/

I would usually have a .eslintrc file in project's root folder to specify rules.

{
  "rules": {
    "quotes": ["error", "double"]
  },
}

  • Related