Skip to content

Commit

Permalink
docs: add eslint.validate to enable linting for supported filetypes…
Browse files Browse the repository at this point in the history
… with VSCode ESLint (#204)

Co-authored-by: Anthony Fu <[email protected]>
  • Loading branch information
DrJume and antfu authored Jun 28, 2023
1 parent 2bf0c8d commit 6dfc773
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
}
```
Expand Down

0 comments on commit 6dfc773

Please sign in to comment.