Skip to content

Commit

Permalink
Fix typescript errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kubit-ui committed Dec 7, 2024
1 parent 5ba20d9 commit fe4c240
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 40 deletions.
66 changes: 34 additions & 32 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kubit-ui-web/react-components",
"version": "1.16.1",
"version": "1.17.0",
"description": "Kubit React Components is a customizable, accessible library of React web components, designed to enhance your application's user experience",
"author": {
"name": "Kubit",
Expand Down Expand Up @@ -87,60 +87,62 @@
"license": "Apache-2.0",
"devDependencies": {
"@babel/core": "^7.26.0",
"@babel/helper-environment-visitor": "^7.24.7",
"@babel/helper-split-export-declaration": "^7.24.7",
"@babel/preset-env": "^7.26.0",
"@babel/preset-react": "^7.25.9",
"@babel/preset-react": "^7.26.3",
"@babel/preset-typescript": "^7.26.0",
"@eslint/compat": "^1.2.3",
"@eslint/compat": "^1.2.4",
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.15.0",
"@eslint/js": "^9.16.0",
"@kubit-ui-web/eslint-plugin-no-index-import": "^1.0.2",
"@storybook/addon-a11y": "^8.4.4",
"@storybook/addon-controls": "^8.4.4",
"@storybook/addon-a11y": "^8.4.7",
"@storybook/addon-controls": "^8.4.7",
"@storybook/addon-coverage": "^1.0.4",
"@storybook/addon-essentials": "^8.4.4",
"@storybook/addon-interactions": "^8.4.4",
"@storybook/addon-links": "^8.4.4",
"@storybook/addon-themes": "^8.4.4",
"@storybook/blocks": "^8.4.4",
"@storybook/react": "^8.4.4",
"@storybook/react-vite": "^8.4.4",
"@storybook/addon-essentials": "^8.4.7",
"@storybook/addon-interactions": "^8.4.7",
"@storybook/addon-links": "^8.4.7",
"@storybook/addon-themes": "^8.4.7",
"@storybook/blocks": "^8.4.7",
"@storybook/react": "^8.4.7",
"@storybook/react-vite": "^8.4.7",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.0.1",
"@testing-library/react": "^16.1.0",
"@testing-library/react-hooks": "^8.0.1",
"@testing-library/user-event": "^14.5.2",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/jest": "^29.5.14",
"@types/jest-axe": "^3.5.9",
"@types/mocha": "^10.0.9",
"@types/mocha": "^10.0.10",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/styled-components": "^5.1.34",
"@types/ungap__structured-clone": "^1.2.0",
"@typescript-eslint/eslint-plugin": "^8.14.0",
"@typescript-eslint/parser": "^8.14.0",
"@typescript-eslint/eslint-plugin": "^8.17.0",
"@typescript-eslint/parser": "^8.17.0",
"@ungap/structured-clone": "^1.2.0",
"@vitejs/plugin-react": "^4.3.3",
"@vitejs/plugin-react": "^4.3.4",
"babel-jest": "^29.7.0",
"cpy-cli": "^5.0.0",
"eslint": "^9.15.0",
"eslint": "^9.16.0",
"eslint-config-prettier": "^9.1.0",
"eslint-config-standard-with-typescript": "^43.0.1",
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-import-resolver-typescript": "^3.7.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jest": "^28.9.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-n": "^17.13.2",
"eslint-plugin-n": "^17.14.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "5.2.1",
"eslint-plugin-promise": "^7.1.0",
"eslint-plugin-promise": "^7.2.1",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-react-refresh": "^0.4.14",
"eslint-plugin-storybook": "^0.11.0",
"eslint-plugin-react-hooks": "^5.1.0",
"eslint-plugin-react-refresh": "^0.4.16",
"eslint-plugin-storybook": "^0.11.1",
"eslint-plugin-unused-imports": "^4.1.4",
"globals": "^15.12.0",
"globals": "^15.13.0",
"gts": "^6.0.2",
"html-validate": "^8.25.0",
"html-validate": "^8.27.0",
"jest": "^29.7.0",
"jest-axe": "^9.0.0",
"jest-canvas-mock": "^2.5.2",
Expand All @@ -149,15 +151,15 @@
"jest-junit": "^16.0.0",
"jest-styled-components": "^7.2.0",
"json-beautify": "^1.1.1",
"prettier": "^3.3.3",
"prettier": "^3.4.2",
"react-transition-group": "^4.4.5",
"sort-imports": "^1.1.0",
"storybook": "^8.4.4",
"storybook": "^8.4.7",
"ts-jest": "^29.2.5",
"tsc-alias": "1.8.10",
"typedoc": "^0.26.11",
"typescript": "^5.6.3",
"vite": "^5.4.11",
"typedoc": "^0.27.3",
"typescript": "^5.7.2",
"vite": "^6.0.3",
"vite-tsconfig-paths": "^4.3.2",
"yarn-deduplicate": "^6.0.2"
},
Expand Down
4 changes: 2 additions & 2 deletions src/components/drawer/drawerStandAlone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const DrawerStandAloneComponent = (
<DrawerTitleContentFooterContainerStyled blocked={blocked} styles={props.styles}>
<DrawerTitleStyled
data-drawer-title
as={Text}
as={Text as any}
component={titleComponent as unknown as TextComponentType}
customTypography={props.styles.title}
id={titleIdFinal}
Expand All @@ -79,7 +79,7 @@ const DrawerStandAloneComponent = (
{props.footer?.content && (props.styles.footer?.variant || props.footer.variant) && (
<DrawerFooterStyled
data-drawer-footer
as={Footer}
as={Footer as any}
customFooterStyles={props.styles}
variant={props.styles.footer?.variant}
{...props.footer}
Expand Down
2 changes: 1 addition & 1 deletion src/components/elementOrIcon/elementOrIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const ElementOrIconComponent = (
);
}
// element as jsx element
return <>{element}</>;
return <>{element as React.ReactNode}</>;
};

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const ElementOrIllustrationComponent = (
return <Illustration {...rest} ref={ref} illustration={element} />;
}
// element as jsx element
return <>{element}</>;
return <>{element as React.ReactNode}</>;
};

/**
Expand Down
2 changes: 1 addition & 1 deletion src/components/navigationCard/navigationCardStandAlone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const NavigationCardStandaloneComponent = (
return (
// Can not be spread -> styled component breaks
<NavigationCardStyled
ref={ref as React.ForwardedRef<HTMLButtonElement>}
ref={ref as any}
aria-disabled={props['aria-disabled']}
as={props.url ? props.component : 'button'}
className={props.className}
Expand Down
2 changes: 1 addition & 1 deletion src/components/pillV2/pillStandAlone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const PillStandAloneComponent = (
ref={ref}
{...ariaProps}
aria-selected={type === PillType.TAB ? props.selected : undefined}
as={[PillType.BUTTON, PillType.TAB].includes(type) ? PillAsButton : undefined}
as={([PillType.BUTTON, PillType.TAB].includes(type) ? PillAsButton : undefined) as any}
data-testid={dataTestId}
role={type === PillType.TAB ? ROLES.TAB : undefined}
styles={props.styles}
Expand Down
1 change: 0 additions & 1 deletion src/types/styled.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@ export interface CustomTheme {
}

declare module 'styled-components' {
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface DefaultTheme extends CustomTheme {}
}
2 changes: 1 addition & 1 deletion tsconfig.tsbuildinfo

Large diffs are not rendered by default.

0 comments on commit fe4c240

Please sign in to comment.