Skip to content

fix: refactor resulting in miss TS type #543

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 1, 2023
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
5 changes: 1 addition & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
const base = require('@umijs/fabric/dist/eslint');

module.exports = {
...base,
extends: [require.resolve('@umijs/fabric/dist/eslint')],
rules: {
...base.rules,
'no-template-curly-in-string': 0,
'prefer-promise-reject-errors': 0,
'react/no-array-index-key': 0,
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { default } from './Pagination';
export type { PaginationProps } from './interface';
export type * from './interface';
Copy link

@heath-freenome heath-freenome Dec 12, 2023

Choose a reason for hiding this comment

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

@afc163 This change is causing an issue when I am attempting to build with the latest version of rc-pagination
I'm seeing:

> tsc -b

node_modules/rc-pagination/lib/index.d.ts:2:1 - error TS1383: Only named exports may use 'export type'.

2 export type * from './interface';
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If you change this to export * from ./interfaceI believe things will do what you want and avoids this typescript error. This works fine becauseinterface.ts` is just a collection of types

Copy link
Member

Choose a reason for hiding this comment

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

Could you provide a reproduce codesandbox?