From 6dfc773b052b9c0d086961f2435918718cbedfd6 Mon Sep 17 00:00:00 2001 From: Julian Meinking <12785972+DrJume@users.noreply.github.com> Date: Wed, 28 Jun 2023 14:10:01 +0200 Subject: [PATCH] docs: add `eslint.validate` to enable linting for supported filetypes with VSCode ESLint (#204) Co-authored-by: Anthony Fu --- README.md | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 434de01..e02ea8a 100644 --- a/README.md +++ b/README.md @@ -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" + ] } } ```