From 39a95cc50de834b25106a321abd752bf5cc3c11e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=88=AA=E5=AE=87?= <3364451258@qq.com> Date: Wed, 27 May 2026 00:58:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20CI=20=E5=88=87=E6=8D=A2=E5=88=B0=20MSVC?= =?UTF-8?q?=20=E5=B7=A5=E5=85=B7=E9=93=BE=E3=80=81=E6=B7=BB=E5=8A=A0=20esl?= =?UTF-8?q?int.config.js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Rust: windows-latest 默认 MSVC,无需额外安装 GNU/MinGW - ESLint: 添加 eslint flat config(js + tseslint + react-hooks) Co-Authored-By: Claude Opus 4.7 --- .github/workflows/ci.yml | 8 -------- .github/workflows/release.yml | 8 -------- eslint.config.js | 24 ++++++++++++++++++++++++ 3 files changed, 24 insertions(+), 16 deletions(-) create mode 100644 eslint.config.js diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bb89c49..f6421b7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,14 +42,6 @@ jobs: steps: - uses: actions/checkout@v4 - - name: 安装 GNU 工具链 - run: | - rustup toolchain install stable-x86_64-pc-windows-gnu - rustup override set stable-x86_64-pc-windows-gnu - - - name: 添加 MinGW 到 PATH - run: echo "C:\msys64\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Append - - name: Cargo Check run: cargo check diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 931ff90..00cfd05 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,14 +21,6 @@ jobs: - run: npm ci - - name: 安装 GNU 工具链 - run: | - rustup toolchain install stable-x86_64-pc-windows-gnu - rustup override set stable-x86_64-pc-windows-gnu - - - name: 添加 MinGW 到 PATH - run: echo "C:\msys64\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Append - - name: Tauri Build run: npx tauri build diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..8e37764 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,24 @@ +import js from '@eslint/js'; +import tseslint from 'typescript-eslint'; +import reactHooks from 'eslint-plugin-react-hooks'; +import reactRefresh from 'eslint-plugin-react-refresh'; +import globals from 'globals'; + +export default tseslint.config( + { ignores: ['dist', 'src-tauri'] }, + { + extends: [js.configs.recommended, ...tseslint.configs.recommended], + files: ['**/*.{ts,tsx}'], + languageOptions: { + globals: globals.browser, + }, + plugins: { + 'react-hooks': reactHooks, + 'react-refresh': reactRefresh, + }, + rules: { + ...reactHooks.configs.recommended.rules, + 'react-refresh/only-export-components': ['warn', { allowConstantExport: true }], + }, + }, +);