diff --git a/.github/workflows/surge-preview.yml b/.github/workflows/surge-preview.yml index cffac6cc6..ba6303740 100644 --- a/.github/workflows/surge-preview.yml +++ b/.github/workflows/surge-preview.yml @@ -33,7 +33,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/docs/examples/components/useDraggable.ts b/docs/examples/components/useDraggable.ts index 0dde2ffbf..b13967133 100644 --- a/docs/examples/components/useDraggable.ts +++ b/docs/examples/components/useDraggable.ts @@ -1,8 +1,9 @@ import { useRef } from 'react'; -import type { DragObjectWithType } from 'react-dnd'; import { useDrag, useDrop } from 'react-dnd'; -type DragWithIndex = DragObjectWithType & { +type DragWithIndex = { + type: string; + id: string | number; index: number; }; export default function useDraggable( @@ -69,6 +70,7 @@ export default function useDraggable( }, }); const [{ isDragging }, drag] = useDrag({ + type, item: { type, id, index }, collect: monitor => ({ isDragging: monitor.isDragging(), diff --git a/docs/examples/stateForm-list-draggable.tsx b/docs/examples/stateForm-list-draggable.tsx index 2188ff14f..c88a347e1 100644 --- a/docs/examples/stateForm-list-draggable.tsx +++ b/docs/examples/stateForm-list-draggable.tsx @@ -2,7 +2,7 @@ import React from 'react'; /* eslint-enable react/prop-types */ -import HTML5Backend from 'react-dnd-html5-backend'; +import { HTML5Backend } from 'react-dnd-html5-backend'; import { DndProvider } from 'react-dnd'; import Form, { List, useForm } from 'rc-field-form'; import Input from './components/Input'; diff --git a/eslint.config.mjs b/eslint.config.mjs index 40f08ec94..a298e8e02 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 fd8f4f5af..73d0439fb 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,8 @@ "clsx": "^2.1.1" }, "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", @@ -68,7 +69,7 @@ "@types/react": "^19.2.17", "@types/react-dom": "^19.2.3", "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", @@ -82,8 +83,8 @@ "prettier": "^3.9.4", "rc-test": "^7.1.3", "react": "^19.2.7", - "react-dnd": "^8.0.3", - "react-dnd-html5-backend": "^8.0.3", + "react-dnd": "^16.0.1", + "react-dnd-html5-backend": "^16.0.1", "react-dom": "^19.2.7", "react-redux": "^9.0.4", "redux": "^5.0.0",