From 315d9b2c316b2f6387dd3920fb40e04b4bda4e3b Mon Sep 17 00:00:00 2001 From: aojunhao123 <1844749591@qq.com> Date: Sat, 27 Jun 2026 22:38:19 +0800 Subject: [PATCH 1/2] chore: upgrade TypeScript to 6.0.3 Bump typescript from ^5.9.3 to ^6.0.3 (latest stable; the JS-based compiler, ecosystem-compatible). TS 7 is the native rewrite and does not yet expose the JS compiler API that father/typescript-eslint need. Modernize tsconfig for 6.x's deprecations (removed in 7.0): - moduleResolution: node -> bundler - drop deprecated baseUrl - make path mappings relative Verified: pnpm compile (dts + eslint hook), pnpm test (28/28), tsc --noEmit on src all pass. --- package.json | 2 +- tsconfig.json | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 3403576..0aa68cd 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ "react": "^19.2.0", "react-dom": "^19.2.0", "regenerator-runtime": "^0.14.1", - "typescript": "^5.9.3" + "typescript": "^6.0.3" }, "peerDependencies": { "react": ">=18.0.0", diff --git a/tsconfig.json b/tsconfig.json index 464824d..39898e6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,17 +1,16 @@ { "compilerOptions": { "target": "esnext", - "moduleResolution": "node", - "baseUrl": "./", + "moduleResolution": "bundler", "jsx": "react", "declaration": true, "skipLibCheck": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true, "paths": { - "@/*": ["src/*"], - "@@/*": [".dumi/tmp/*"], - "@rc-component/listy": ["src/index.ts"] + "@/*": ["./src/*"], + "@@/*": ["./.dumi/tmp/*"], + "@rc-component/listy": ["./src/index.ts"] }, "types": ["@testing-library/jest-dom", "node"] } From 0f80f1b35704c87168b4febcf9abb11f883ac66a Mon Sep 17 00:00:00 2001 From: aojunhao123 <1844749591@qq.com> Date: Sat, 27 Jun 2026 23:26:38 +0800 Subject: [PATCH 2/2] chore: fix tsc --noEmit under TypeScript 6 TS 6 enables noImplicitAny by default, surfacing latent issues: - add ambient declare module '*.less' for docs example imports - annotate implicitly-any test params/vars in RawList tests tsc --noEmit -p tsconfig.json now passes with zero errors. --- tests/listy.behavior.test.tsx | 12 ++++++------ typings.d.ts | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 typings.d.ts diff --git a/tests/listy.behavior.test.tsx b/tests/listy.behavior.test.tsx index cf831a2..ac8ec7a 100644 --- a/tests/listy.behavior.test.tsx +++ b/tests/listy.behavior.test.tsx @@ -23,7 +23,7 @@ jest.mock('@rc-component/virtual-list', () => { getSize: () => ({ top: 0, bottom: 0 }), }; let scrollHandler = (config: any) => {}; - let lastProps = null; + let lastProps: any = null; const MockVirtualList = React.forwardRef((props: any, ref: any) => { lastProps = props; @@ -286,7 +286,7 @@ describe('Listy behaviors', () => { ref={ref} data={[{ id: 1 }]} group={undefined} - itemRender={(item) =>