From d82e0a22cceb3e3cfef79e1c97eee848146fb180 Mon Sep 17 00:00:00 2001 From: Rui Wu Date: Wed, 28 Aug 2024 15:06:37 +0800 Subject: [PATCH] chore: update vsc settings --- .vscode/settings.json | 68 ++++++++++++++++++------------------------- 1 file changed, 28 insertions(+), 40 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 42aa1d2..f436729 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,53 +1,28 @@ { - // Enable the ESlint flat config support - "eslint.experimental.useFlatConfig": true, // Disable the default formatter, use eslint instead "prettier.enable": false, "editor.formatOnSave": false, + // Auto fix "editor.codeActionsOnSave": { - "source.fixAll": "explicit", + "source.fixAll.eslint": "explicit", "source.organizeImports": "never" }, + // Silent the stylistic rules in you IDE, but still auto fix them "eslint.rules.customizations": [ - { - "rule": "style/*", - "severity": "off" - }, - { - "rule": "*-indent", - "severity": "off" - }, - { - "rule": "*-spacing", - "severity": "off" - }, - { - "rule": "*-spaces", - "severity": "off" - }, - { - "rule": "*-order", - "severity": "off" - }, - { - "rule": "*-dangle", - "severity": "off" - }, - { - "rule": "*-newline", - "severity": "off" - }, - { - "rule": "*quotes", - "severity": "off" - }, - { - "rule": "*semi", - "severity": "off" - } + { "rule": "style/*", "severity": "off", "fixable": true }, + { "rule": "format/*", "severity": "off", "fixable": true }, + { "rule": "*-indent", "severity": "off", "fixable": true }, + { "rule": "*-spacing", "severity": "off", "fixable": true }, + { "rule": "*-spaces", "severity": "off", "fixable": true }, + { "rule": "*-order", "severity": "off", "fixable": true }, + { "rule": "*-dangle", "severity": "off", "fixable": true }, + { "rule": "*-newline", "severity": "off", "fixable": true }, + { "rule": "*quotes", "severity": "off", "fixable": true }, + { "rule": "*semi", "severity": "off", "fixable": true } ], + // Enable eslint for all supported languages "eslint.validate": [ "javascript", @@ -59,8 +34,21 @@ "markdown", "json", "jsonc", - "yaml" + "yaml", + "toml", + "xml", + "gql", + "graphql", + "astro", + "svelte", + "css", + "less", + "scss", + "pcss", + "postcss" ], + + // Enable file nesting "explorer.fileNesting.enabled": true, "explorer.fileNesting.patterns": { "vite.config.*": "pages.config.*, manifest.config.*, uno.config.*, volar.config.*, *.env, .env.*"