From e9a625ec5f7754e49e5b220accfd6ef8ca33d6a5 Mon Sep 17 00:00:00 2001 From: m1m1sha <18262227804@163.com> Date: Tue, 7 May 2024 10:39:06 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=B3=20chore:=20eslint=20config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- EasyTier.code-workspace | 77 +++++++++++++++++++++++++++++- easytier-gui/.gitignore | 2 +- easytier-gui/.npmrc | 2 - easytier-gui/.vscode/settings.json | 71 +-------------------------- easytier-gui/eslint.config.js | 13 +++-- 5 files changed, 83 insertions(+), 82 deletions(-) delete mode 100644 easytier-gui/.npmrc diff --git a/EasyTier.code-workspace b/EasyTier.code-workspace index fde50c1..e3e7837 100644 --- a/EasyTier.code-workspace +++ b/EasyTier.code-workspace @@ -10,5 +10,78 @@ "path": "easytier" } ], - "settings": {} -} \ No newline at end of file + "settings": { + "eslint.experimental.useFlatConfig": true, + "prettier.enable": false, + "editor.formatOnSave": false, + "editor.codeActionsOnSave": { + "source.fixAll.eslint": "explicit", + "source.organizeImports": "never" + }, + "eslint.rules.customizations": [ + { + "rule": "style/*", + "severity": "off" + }, + { + "rule": "style/eol-last", + "severity": "error" + }, + { + "rule": "format/*", + "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" + } + ], + "eslint.validate": [ + "code-workspace", + "javascript", + "javascriptreact", + "typescript", + "typescriptreact", + "vue", + "html", + "markdown", + "json", + "jsonc", + "yaml", + "toml", + "gql", + "graphql" + ], + "i18n-ally.localesPaths": [ + "easytier-gui/locales" + ] + } +} diff --git a/easytier-gui/.gitignore b/easytier-gui/.gitignore index 3ab2416..49ef0bd 100644 --- a/easytier-gui/.gitignore +++ b/easytier-gui/.gitignore @@ -13,7 +13,7 @@ dist-ssr *.local # Editor directories and files -.vscode/ +.vscode/* !.vscode/extensions.json !.vscode/settings.json .idea diff --git a/easytier-gui/.npmrc b/easytier-gui/.npmrc deleted file mode 100644 index 1cfbd6f..0000000 --- a/easytier-gui/.npmrc +++ /dev/null @@ -1,2 +0,0 @@ -shamefully-hoist=true -strict-peer-dependencies=false \ No newline at end of file diff --git a/easytier-gui/.vscode/settings.json b/easytier-gui/.vscode/settings.json index 6bf155a..90be503 100644 --- a/easytier-gui/.vscode/settings.json +++ b/easytier-gui/.vscode/settings.json @@ -1,74 +1,5 @@ { "i18n-ally.localesPaths": [ "locales" - ], - // 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.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": "format/*", - "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" - } - ], - // Enable eslint for all supported languages - "eslint.validate": [ - "javascript", - "javascriptreact", - "typescript", - "typescriptreact", - "vue", - "html", - "markdown", - "json", - "jsonc", - "yaml", - "toml", - "gql", - "graphql" ] -} \ No newline at end of file +} diff --git a/easytier-gui/eslint.config.js b/easytier-gui/eslint.config.js index 6bc3ab7..a0739ab 100644 --- a/easytier-gui/eslint.config.js +++ b/easytier-gui/eslint.config.js @@ -3,13 +3,12 @@ import antfu from '@antfu/eslint-config' export default antfu({ formatters: true, + rules: { + 'style/eol-last': ['error', 'always'], + }, ignores: [ - 'dist', - 'node_modules', - 'src-tauri', - 'src/vite-env.d.ts', - 'src/typed-router.d.ts', - 'src/auto-imports.d.ts', - 'src/components.d.ts', + 'src-tauri/**', + '**/vite-env.d.ts', + '**/typed-router.d.ts', ], })