Skip to content

Commit f1ff2c5

Browse files
authored
fix: remove unnecessary TypeScript ignores (#22279)
1 parent 7854d9c commit f1ff2c5

6 files changed

Lines changed: 6 additions & 17 deletions

File tree

packages/react/src/components/Button/Button.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
import PropTypes from 'prop-types';
9-
import React, { type ReactNode } from 'react';
9+
import React from 'react';
1010
import { IconButton, IconButtonKind, IconButtonKinds } from '../IconButton';
1111
import { PopoverAlignment } from '../Popover';
1212
import ButtonBase from './ButtonBase';
@@ -125,8 +125,11 @@ export type ButtonProps<T extends React.ElementType> =
125125
PolymorphicComponentPropWithRef<T, ButtonBaseProps>;
126126

127127
export type ButtonComponent = <T extends React.ElementType = 'button'>(
128-
props: ButtonProps<T>
129-
) => ReactNode;
128+
props: ButtonProps<T>,
129+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
130+
context?: any
131+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
132+
) => React.ReactElement | any;
130133

131134
function isIconOnlyButton(
132135
hasIconOnly: ButtonBaseProps['hasIconOnly'],

packages/react/src/components/DataTable/TableExpandRow.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,6 @@ TableExpandRow.propTypes = {
197197
* Specify the string read by a voice reader when the expand trigger is
198198
* focused
199199
*/
200-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452
201-
/**@ts-ignore*/
202200
'aria-label': PropTypes.string,
203201

204202
/**

packages/react/src/components/Dialog/Dialog.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,8 +424,6 @@ const DialogControls = React.forwardRef<HTMLDivElement, DialogControlsProps>(
424424
({ children, ...rest }, ref) => {
425425
const prefix = usePrefix();
426426
return (
427-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452
428-
// @ts-ignore
429427
<div className={`${prefix}--dialog__header-controls`} ref={ref} {...rest}>
430428
{children}
431429
</div>

packages/react/src/components/FluidMultiSelect/FluidMultiSelect.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,6 @@ const FluidMultiSelect = React.forwardRef(function FluidMultiSelect<ItemType>(
178178
{...other}
179179
/>
180180
) : (
181-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452
182-
// @ts-ignore
183181
<MultiSelect ref={ref} className={classNames} {...other} />
184182
)}
185183
</FormContext.Provider>

packages/react/src/components/MenuButton/index.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,6 @@ MenuButton.propTypes = {
265265
/**
266266
* Specify the type of button to be used as the base for the trigger button.
267267
*/
268-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452
269-
// @ts-ignore-next-line -- avoid spurious (?) TS2322 error
270268
kind: PropTypes.oneOf(validButtonKinds),
271269

272270
/**
@@ -289,15 +287,11 @@ MenuButton.propTypes = {
289287
/**
290288
* Specify the size of the button and menu.
291289
*/
292-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452
293-
// @ts-ignore-next-line -- avoid spurious (?) TS2322 error
294290
size: PropTypes.oneOf(['xs', 'sm', 'md', 'lg']),
295291

296292
/**
297293
* Specify the tabIndex of the button.
298294
*/
299-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452
300-
// @ts-ignore-next-line -- avoid spurious (?) TS2322 error
301295
tabIndex: PropTypes.number,
302296

303297
/**

packages/react/src/components/MultiSelect/FilterableMultiSelect.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,8 +1221,6 @@ FilterableMultiSelect.propTypes = {
12211221
* change, and in some cases they can not be shimmed by Carbon to shield you
12221222
* from potentially breaking changes.
12231223
*/
1224-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452
1225-
// @ts-ignore
12261224
downshiftProps: PropTypes.shape(Downshift.propTypes),
12271225

12281226
/**

0 commit comments

Comments
 (0)