docs: add eslint.validate to enable linting for supported filetypes with VSCode ESLint (#204)

Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
This commit is contained in:
Julian Meinking 2023-06-28 14:10:01 +02:00 committed by GitHub
parent 2bf0c8d727
commit 6dfc773b05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,17 +41,36 @@ For example:
}
```
### Config VS Code auto fix
### VS Code support (auto fix)
Install [VS Code ESLint extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) and create `.vscode/settings.json`
Install [VS Code ESLint extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
```json
Add the following settings to your `settings.json`:
```jsonc
{
"prettier.enable": false,
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.organizeImports": false
"source.organizeImports": false,
// The following is optional.
// It's better to put under project setting `.vscode/settings.json`
// to avoid conflicts with working with different eslint configs
// that does not support all formats.
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue",
"html",
"markdown",
"json",
"jsonc",
"yaml"
]
}
}
```