Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
12 changes: 6 additions & 6 deletions tests/listy.behavior.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -286,7 +286,7 @@ describe('Listy behaviors', () => {
ref={ref}
data={[{ id: 1 }]}
group={undefined}
itemRender={(item) => <div>{item.id}</div>}
itemRender={(item: { id: number }) => <div>{item.id}</div>}
prefixCls="rc-listy"
rowKey="id"
/>,
Expand All @@ -308,7 +308,7 @@ describe('Listy behaviors', () => {
key: (item: { id: number; group: string }) => item.group,
title,
}}
itemRender={(item) => <div>{item.id}</div>}
itemRender={(item: { id: number }) => <div>{item.id}</div>}
prefixCls="rc-listy"
rowKey="id"
/>,
Expand All @@ -325,9 +325,9 @@ describe('Listy behaviors', () => {
<RawList
data={[{ id: 1 }]}
group={undefined}
itemRender={(item) => <div>{item.id}</div>}
itemRender={(item: { id: number }) => <div>{item.id}</div>}
prefixCls="rc-listy"
rowKey={(item) => `item-${item.id}`}
rowKey={(item: { id: number }) => `item-${item.id}`}
/>,
);

Expand All @@ -341,7 +341,7 @@ describe('Listy behaviors', () => {
<RawList
data={[{ id: 1 }]}
group={undefined}
itemRender={(item) => (
itemRender={(item: { id: number }) => (
<>
<span>{item.id}</span>
</>
Expand Down
9 changes: 4 additions & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
{
"compilerOptions": {
"target": "esnext",
"moduleResolution": "node",
"baseUrl": "./",
"moduleResolution": "bundler",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

When using "moduleResolution": "bundler", it is highly recommended to explicitly set the "module" option (e.g., to "esnext" or "preserve"). Relying on the implicit default of "module" based on "target" can lead to configuration errors (such as TS5095: Option 'moduleResolution' must be set to 'node' ...) in certain IDEs or tooling environments that default to CommonJS.

Suggested change
"moduleResolution": "bundler",
"module": "esnext",
"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"]
}
Expand Down
1 change: 1 addition & 0 deletions typings.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare module '*.less';
Loading