diff --git a/.github/workflows/surge-preview.yml b/.github/workflows/surge-preview.yml index 0a721ebf..5fee9108 100644 --- a/.github/workflows/surge-preview.yml +++ b/.github/workflows/surge-preview.yml @@ -32,7 +32,7 @@ jobs: fi - name: Install dependencies if: ${{ steps.surge-token.outputs.enabled == 'true' }} - run: npm install --legacy-peer-deps --ignore-scripts --no-audit --loglevel=warn + run: npm install --legacy-peer-deps --legacy-peer-deps --ignore-scripts --no-audit --loglevel=warn - name: Build preview if: ${{ steps.surge-token.outputs.enabled == 'true' }} run: npm run build 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 2c4cca38..7efd9d11 100644 --- a/package.json +++ b/package.json @@ -42,10 +42,11 @@ }, "dependencies": { "is-mobile": "^5.0.0", - "react-is": "^18.2.0" + "react-is": "^19.2.7" }, "devDependencies": { - "@eslint/js": "^9.39.4", + "@eslint/js": "^10.0.1", + "@eslint/compat": "^2.1.0", "@rc-component/father-plugin": "^2.2.0", "@rc-component/np": "^1.0.4", "@testing-library/dom": "^10.4.1", @@ -60,7 +61,7 @@ "@types/warning": "^3.0.4", "cross-env": "^10.1.0", "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/setStyle.test.ts b/tests/setStyle.test.ts index 632e5bc8..13233843 100644 --- a/tests/setStyle.test.ts +++ b/tests/setStyle.test.ts @@ -9,14 +9,12 @@ describe('setStyle', () => { }); it('setStyle correct', () => { - let cacheStyle = {}; - const style: CSSProperties = { position: 'relative', width: '100px', }; - cacheStyle = setStyle(style); + const cacheStyle = setStyle(style); expect(document.body.style.cssText.replace(/\s/g, '')).toBe( `${JSON.stringify(style) @@ -31,9 +29,8 @@ describe('setStyle', () => { it('setStyle correct if has style', () => { document.body.style.position = 'absolute'; - let cacheStyle = {}; - cacheStyle = setStyle({ + const cacheStyle = setStyle({ position: 'relative', });