diff --git a/.github/workflows/surge-preview.yml b/.github/workflows/surge-preview.yml index 394f2b02..c4c39b67 100644 --- a/.github/workflows/surge-preview.yml +++ b/.github/workflows/surge-preview.yml @@ -31,7 +31,7 @@ jobs: - name: Build preview if: ${{ steps.surge-token.outputs.enabled == 'true' }} run: | - npm install + npm install --legacy-peer-deps npm run build - uses: afc163/surge-preview@bf90a5a86111f6311ca42f0a5a0f80fb0fb03cec if: ${{ steps.surge-token.outputs.enabled == 'true' }} diff --git a/eslint.config.mjs b/eslint.config.mjs index 40f08ec9..a298e8e0 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,4 +1,5 @@ import js from '@eslint/js'; +import { fixupConfigRules } from '@eslint/compat'; import { defineConfig } from 'eslint/config'; import { dirname } from 'node:path'; import { fileURLToPath } from 'node:url'; @@ -40,8 +41,8 @@ export default defineConfig([ files: ['**/*.{js,jsx,ts,tsx}'], extends: [ js.configs.recommended, - react.configs.flat.recommended, - react.configs.flat['jsx-runtime'], + ...fixupConfigRules(react.configs.flat.recommended), + ...fixupConfigRules(react.configs.flat['jsx-runtime']), prettier, ], plugins: { diff --git a/package.json b/package.json index 4b5957be..7e62bf26 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,8 @@ "clsx": "^2.1.1" }, "devDependencies": { - "@eslint/js": "^9.39.4", + "@eslint/js": "^10.0.1", + "@eslint/compat": "^2.1.0", "@rc-component/dialog": "^1.10.0", "@rc-component/father-plugin": "^2.2.0", "@rc-component/np": "^1.0.4", @@ -68,7 +69,7 @@ "@types/react-dom": "^19.2.3", "babel-jest": "^30.4.1", "dumi": "^2.4.38", - "eslint": "^9.39.4", + "eslint": "^10.6.0", "eslint-config-prettier": "^10.1.8", "eslint-plugin-jest": "^29.15.4", "eslint-plugin-react": "^7.37.5", diff --git a/tests/Combobox.test.tsx b/tests/Combobox.test.tsx index 9b93fafc..a0801383 100644 --- a/tests/Combobox.test.tsx +++ b/tests/Combobox.test.tsx @@ -287,14 +287,10 @@ describe('Select.Combobox', () => { const Test = () => { const [options, setOptions] = React.useState([]); const onSearch = (value: string) => { - let res = []; - - if (!value || value.indexOf('@') >= 0) { - res = []; - } else { - const email = `${value}@gmail.com`; - res = [{ value: email, label: email }]; - } + const res = + !value || value.indexOf('@') >= 0 + ? [] + : [{ value: `${value}@gmail.com`, label: `${value}@gmail.com` }]; setOptions(res); }; return ( diff --git a/tests/Select.test.tsx b/tests/Select.test.tsx index 922aa495..b8cbcce3 100644 --- a/tests/Select.test.tsx +++ b/tests/Select.test.tsx @@ -2727,7 +2727,6 @@ describe('Select.Basic', () => { }); it('release Enter key lock after customize input calls blur()', async () => { - let inputElem: HTMLInputElement | null = null; const onBlur = jest.fn(); const Demo: React.FC = () => { const ref = React.useRef(null); @@ -2747,7 +2746,7 @@ describe('Select.Basic', () => { ); }; const { container } = render(); - inputElem = container.querySelector('input'); + const inputElem = container.querySelector('input'); toggleOpen(container); await waitFakeTimer(); expectOpen(container, true);