Skip to content
Open
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
8 changes: 7 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,17 @@ export default defineConfig(
},
},
rules: {
// All of these rules have directives in the codebase that disable them,
// These rules have directives in the codebase that disable them,
// which implies that they were set previously.
'no-console': 'error',
'no-template-curly-in-string': 'error',
'prefer-arrow-callback': ['error', { allowNamedFunctions: true }],
'require-atomic-updates': 'error',

'@typescript-eslint/no-unused-vars': [
'error',
{ ignoreRestSiblings: true },
],
},
},
{
Expand Down Expand Up @@ -217,6 +222,7 @@ export default defineConfig(
files: ['packages/react/code-connect/**/*.figma.tsx'],
rules: {
'@typescript-eslint/ban-ts-comment': ['error', { 'ts-nocheck': false }],
'@typescript-eslint/no-unused-vars': 'off',
},
},
{
Expand Down
18 changes: 6 additions & 12 deletions packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ Map {
"render": [Function],
},
"AILabelActions" => {
"$$typeof": Symbol(react.forward_ref),
"displayName": "AILabelActions",
"propTypes": {
"children": {
"type": "node",
Expand All @@ -169,10 +169,9 @@ Map {
"type": "string",
},
},
"render": [Function],
},
"AILabelContent" => {
"$$typeof": Symbol(react.forward_ref),
"displayName": "AILabelContent",
"propTypes": {
"children": {
"type": "node",
Expand All @@ -181,7 +180,6 @@ Map {
"type": "string",
},
},
"render": [Function],
},
"AISkeletonIcon" => {
"propTypes": {
Expand Down Expand Up @@ -13798,7 +13796,7 @@ Map {
"render": [Function],
},
"preview__SlugActions" => {
"$$typeof": Symbol(react.forward_ref),
"displayName": "AILabelActions",
"propTypes": {
"children": {
"type": "node",
Expand All @@ -13807,10 +13805,9 @@ Map {
"type": "string",
},
},
"render": [Function],
},
"preview__SlugContent" => {
"$$typeof": Symbol(react.forward_ref),
"displayName": "AILabelContent",
"propTypes": {
"children": {
"type": "node",
Expand All @@ -13819,7 +13816,6 @@ Map {
"type": "string",
},
},
"render": [Function],
},
"preview_useFeatureFlag" => {},
"preview_useFeatureFlags" => {},
Expand Down Expand Up @@ -15780,7 +15776,7 @@ Map {
"render": [Function],
},
"unstable__SlugActions" => {
"$$typeof": Symbol(react.forward_ref),
"displayName": "AILabelActions",
"propTypes": {
"children": {
"type": "node",
Expand All @@ -15789,10 +15785,9 @@ Map {
"type": "string",
},
},
"render": [Function],
},
"unstable__SlugContent" => {
"$$typeof": Symbol(react.forward_ref),
"displayName": "AILabelContent",
"propTypes": {
"children": {
"type": "node",
Expand All @@ -15801,7 +15796,6 @@ Map {
"type": "string",
},
},
"render": [Function],
},
"unstable_useFeatureFlag" => {},
"unstable_useFeatureFlags" => {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ figma.connect(
}),
},
example: ({
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
size,
title,
label,
Expand All @@ -46,7 +45,7 @@ figma.connect(
descriptionText,
progress,
}) => {
// eslint-disable-next-line @typescript-eslint/no-unused-vars , react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20452
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20452
const [open, setOpen] = useState(true);
return (
<ComposedModal open onClose={() => setOpen(false)}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import React from 'react';
import { ContainedList } from '@carbon/react';
import figma from '@figma/code-connect';
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
import { title } from 'process';

const sharedContainedListProps = {
Expand Down
5 changes: 0 additions & 5 deletions packages/react/code-connect/DataTable/DataTable.figma.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ figma.connect(
example: ({
headerItem,
headerRow,
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
headerRowItems,
rowItems,
pagination,
Expand Down Expand Up @@ -94,7 +93,6 @@ figma.connect(
example: ({
headerItem,
headerRow,
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
headerRowItems,
rowItems,
pagination,
Expand Down Expand Up @@ -132,7 +130,6 @@ figma.connect(
example: ({
headerItem,
headerRow,
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
headerRowItems,
rowItems,
pagination,
Expand Down Expand Up @@ -170,7 +167,6 @@ figma.connect(
example: ({
headerItem,
headerRow,
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
headerRowItems,
rowItems,
pagination,
Expand Down Expand Up @@ -208,7 +204,6 @@ figma.connect(
example: ({
headerItem,
headerRow,
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
headerRowItems,
rowItems,
pagination,
Expand Down
2 changes: 0 additions & 2 deletions packages/react/code-connect/MenuButton/MenuButton.figma.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ figma.connect(
'https://www.figma.com/design/YAnB1jKx0yCUL29j6uSLpg/(v11)-All-themes---Carbon-Design-System?node-id=31420-317548&t=KXgYpEhuz2XzSITV-4',
{
props: sharedMenuButtonProps,
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
example: ({ size, children, menuAlignment, button }) => (
<MenuButton
size={size}
Expand All @@ -62,7 +61,6 @@ figma.connect(
{
variant: { Open: 'True' },
props: sharedMenuButtonProps,
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
example: ({ size, children, menuAlignment, button, menu }) => (
<MenuButton
size={size}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ figma.connect(
isFlush: figma.boolean('Flush'),
rowItems: figma.children(['_Structured list row item']),
},
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
example: ({ isFlush, headerRowItem, rowItems, isCondensed }) => (
<StructuredListWrapper isFlush={isFlush} isCondensed={isCondensed}>
<StructuredListHead>{headerRowItems}</StructuredListHead>
Expand All @@ -50,8 +49,6 @@ figma.connect(
headerRowItems: figma.children(['_Structured list header row item']),
rowItems: figma.children(['_Structured list row item - Selectable']),
},
//
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
example: ({ headerRowItem, rowItems, isCondensed }) => (
<StructuredListWrapper selection isCondensed={isCondensed}>
<StructuredListHead>{headerRowItems}</StructuredListHead>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ figma.connect(
}),
// information: figma.instance('Information'), look at this once icons are connected
},
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
example: ({ align, toggletip }) => (
<>
<ToggletipLabel>Toggletip label</ToggletipLabel>
Expand Down
20 changes: 10 additions & 10 deletions packages/react/src/components/AILabel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ import type {

export type AILabelContentProps = React.HTMLAttributes<HTMLSpanElement>;

export const AILabelContent = React.forwardRef(function AILabelContent(
{ className, children }: AILabelContentProps,
ref // eslint-disable-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
) {
export const AILabelContent = ({
className,
children,
}: AILabelContentProps) => {
const prefix = usePrefix();

const aiLabelContentClasses = cx(className, {
Expand All @@ -45,7 +45,7 @@ export const AILabelContent = React.forwardRef(function AILabelContent(
{children}
</ToggletipContent>
);
});
};

AILabelContent.displayName = 'AILabelContent';
AILabelContent.propTypes = {
Expand All @@ -62,10 +62,10 @@ AILabelContent.propTypes = {

export type AILabelActionsProps = React.HTMLAttributes<HTMLSpanElement>;

export const AILabelActions = React.forwardRef(function AILabelActions(
{ className, children }: AILabelActionsProps,
ref // eslint-disable-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
) {
export const AILabelActions = ({
className,
children,
}: AILabelActionsProps) => {
const prefix = usePrefix();

const aiLabelActionsClasses = cx(className, {
Expand All @@ -77,7 +77,7 @@ export const AILabelActions = React.forwardRef(function AILabelActions(
{children}
</ToggletipActions>
);
});
};

AILabelActions.displayName = 'AILabelActions';
AILabelActions.propTypes = {
Expand Down
3 changes: 1 addition & 2 deletions packages/react/src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright IBM Corp. 2016, 2025
* Copyright IBM Corp. 2016, 2026
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
Expand Down Expand Up @@ -179,7 +179,6 @@ const Button: ButtonComponent = React.forwardRef(
const iconOnlyImage = !ButtonImageElement ? null : <ButtonImageElement />;

if (!isIconOnlyButton(hasIconOnly, kind)) {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { tooltipAlignment, ...propsWithoutTooltipAlignment } = props;
return <ButtonBase ref={ref} {...propsWithoutTooltipAlignment} />;
} else {
Expand Down
7 changes: 3 additions & 4 deletions packages/react/src/components/ComboBox/ComboBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -870,8 +870,7 @@ const ComboBox = forwardRef(
initialSelectedItem: initialSelectedItem,
inputId: id,
stateReducer,
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
isItemDisabled(item, _index) {
isItemDisabled(item) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
return (item as any)?.disabled;
},
Expand Down Expand Up @@ -1237,8 +1236,8 @@ const ComboBox = forwardRef(
// instead match the old behavior of placing the disabled attribute.
const disabled = itemProps['aria-disabled'];
const {
'aria-disabled': unusedAriaDisabled, // eslint-disable-line @typescript-eslint/no-unused-vars
'aria-selected': unusedAriaSelected, // eslint-disable-line @typescript-eslint/no-unused-vars
'aria-disabled': unusedAriaDisabled,
'aria-selected': unusedAriaSelected,
...modifiedItemProps
} = itemProps;

Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/DataTable/DataTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import PropTypes from 'prop-types';
import React, { // eslint-disable-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
import {
useEffect,
useMemo,
useState,
Expand Down
14 changes: 7 additions & 7 deletions packages/react/src/components/DataTable/TableRow.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright IBM Corp. 2016, 2025
* Copyright IBM Corp. 2016, 2026
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
Expand Down Expand Up @@ -30,13 +30,13 @@ const TableRow = frFn((props, ref) => {
// Remove unnecessary props if provided to this component, these are
// only useful in `TableExpandRow`
const {
ariaLabel, // eslint-disable-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
'aria-label': ariaLabelAlt, // eslint-disable-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
'aria-controls': ariaControls, // eslint-disable-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
onExpand, // eslint-disable-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
isExpanded, // eslint-disable-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
ariaLabel,
'aria-label': ariaLabelAlt,
'aria-controls': ariaControls,
onExpand,
isExpanded,
isSelected,
expandHeader, // eslint-disable-line @typescript-eslint/no-unused-vars
expandHeader,
...cleanProps
} = props;

Expand Down
3 changes: 1 addition & 2 deletions packages/react/src/components/Dropdown/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,7 @@ const Dropdown = React.forwardRef(
[onChange]
);

// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
const isItemDisabled = useCallback((item, _index) => {
const isItemDisabled = useCallback((item) => {
const isObject = item !== null && typeof item === 'object';
return isObject && 'disabled' in item && item.disabled === true;
}, []);
Expand Down
6 changes: 1 addition & 5 deletions packages/react/src/components/Grid/CSSGrid.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright IBM Corp. 2016, 2023
* Copyright IBM Corp. 2016, 2026
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
Expand All @@ -11,7 +11,6 @@ import React from 'react';
import { usePrefix } from '../../internal/usePrefix';
import { GridSettings, useGridSettings } from './GridContext';
import { GridComponent, GridBaseProps } from './GridTypes';
import { PolymorphicComponentPropWithRef } from '../../internal/PolymorphicProps';

// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
const CSSGrid = React.forwardRef<
Expand Down Expand Up @@ -137,9 +136,6 @@ interface SubgridBaseProps {
mode?: SubgridMode;
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
type SubgridProps<T extends React.ElementType = 'div'> =
PolymorphicComponentPropWithRef<T, SubgridBaseProps>;
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
const Subgrid = React.forwardRef<
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
Expand Down
11 changes: 2 additions & 9 deletions packages/react/src/components/IconIndicator/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright IBM Corp. 2016, 2023
* Copyright IBM Corp. 2016, 2026
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
Expand Down Expand Up @@ -81,14 +81,7 @@ export interface IconIndicatorProps {
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
export const IconIndicator = React.forwardRef(
(
{
className: customClassName,
kind,
label,
size = 16,
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
...rest
}: IconIndicatorProps,
{ className: customClassName, kind, label, size = 16 }: IconIndicatorProps,
ref: React.Ref<HTMLDivElement>
) => {
const prefix = usePrefix();
Expand Down
Loading
Loading