diff --git a/package.json b/package.json
index b3f3e66e24..4ff8d675bf 100644
--- a/package.json
+++ b/package.json
@@ -28,11 +28,13 @@
"@codesandbox/sandpack-react": "^1.17.0",
"@codesandbox/sandpack-themes": "^1.17.0",
"@floating-ui/react": "^0.21.1",
+ "@types/jest-axe": "^3.5.9",
"chalk": "4.1.2",
"classnames": "^2.3.2",
"glob": "^7.2.0",
"inquirer": "^8.2.0",
"jscodeshift": "^0.13.1",
+ "lz-string": "1.4.4",
"meow": "^5.0.0",
"patch-package": "^6.5.1",
"path": "^0.12.7",
diff --git a/src/axe/testA11y.ts b/src/axe/testA11y.ts
index 11c653b7f3..482e29b93f 100644
--- a/src/axe/testA11y.ts
+++ b/src/axe/testA11y.ts
@@ -22,6 +22,7 @@ import {render} from '@testing-library/react';
* ```
*/
+// @ts-expect-error TS7006
export default async function testA11y(node, axeOptions?) {
const container = React.isValidElement(node)
? render(node, axeOptions).container
diff --git a/src/chromatic/HoverStyle.tsx b/src/chromatic/HoverStyle.tsx
index 62fb64a34b..94f01d487d 100644
--- a/src/chromatic/HoverStyle.tsx
+++ b/src/chromatic/HoverStyle.tsx
@@ -48,14 +48,17 @@ const applyHoverStates = (
const hoverStylesheet = hStylesheet.sheet;
+ // @ts-expect-error TS18047
if (!hoverStylesheet.cssRules || hoverStylesheet.cssRules.length !== 0) {
return;
}
const insertUnhoveredRule = (unhoveredSelector: string) => {
if (unhoveredSelector) {
+ // @ts-expect-error TS18047
hoverStylesheet.insertRule(
unhoveredSelector,
+ // @ts-expect-error TS18047
hoverStylesheet.cssRules.length
);
}
@@ -69,6 +72,7 @@ const applyHoverStates = (
if (conditionText) {
Array.from((rule as CSSGroupingRule).cssRules).forEach(r => {
insertUnhoveredRule(
+ // @ts-expect-error TS2345
generateUnhoveredSelector(
r as CSSStyleRule,
hoverContainerId,
@@ -78,6 +82,7 @@ const applyHoverStates = (
});
} else {
insertUnhoveredRule(
+ // @ts-expect-error TS2345
generateUnhoveredSelector(rule as CSSStyleRule, hoverContainerId)
);
}
@@ -98,6 +103,7 @@ const HoverStyle = ({
const hoverContainerId = 'hover-container';
React.useEffect(() => {
+ // @ts-expect-error TS2345
applyHoverStates(hoverContainerId, styleheetRef.current);
}, []);
diff --git a/src/chromatic/utils.tsx b/src/chromatic/utils.tsx
index 9fc481d3b9..4a34e58eda 100644
--- a/src/chromatic/utils.tsx
+++ b/src/chromatic/utils.tsx
@@ -27,6 +27,7 @@ export const generateChromaticStory: any = (
const storyName = !isNew && storyToHover;
return (
+ // @ts-expect-error TS2322
@@ -36,6 +37,7 @@ export const generateChromaticStory: any = (
);
};
+// @ts-expect-error TS7006
const mergeStories: any = module => {
const stories = Object.keys(module)
.filter(
diff --git a/src/components/accordion/Accordion.chromatic.stories.tsx b/src/components/accordion/Accordion.chromatic.stories.tsx
index 4246407140..6b3e0c931b 100644
--- a/src/components/accordion/Accordion.chromatic.stories.tsx
+++ b/src/components/accordion/Accordion.chromatic.stories.tsx
@@ -14,6 +14,7 @@ const copy = {
"Now your family member just needs to open the link and hit 'accept'. If they aren't already on Brainly",
};
+// @ts-expect-error TS7006
const WithTooltip = args => {
const handleChange = () => null;
diff --git a/src/components/accordion/Accordion.tsx b/src/components/accordion/Accordion.tsx
index 7bcdddaa9d..14680cb439 100644
--- a/src/components/accordion/Accordion.tsx
+++ b/src/components/accordion/Accordion.tsx
@@ -167,6 +167,7 @@ const Accordion = ({
const wrapper = wrapperRef.current;
function handleKeyDown(event: KeyboardEvent) {
+ // @ts-expect-error TS7053
const key = KEY_CODES[event.keyCode];
if (['space', 'enter'].includes(key)) {
diff --git a/src/components/action-list/ActionList.spec.tsx b/src/components/action-list/ActionList.spec.tsx
index f3c96a44a8..e01e739e8d 100644
--- a/src/components/action-list/ActionList.spec.tsx
+++ b/src/components/action-list/ActionList.spec.tsx
@@ -18,6 +18,7 @@ describe('ActionList', () => {
);
const root = actionList.container.firstElementChild;
+ // @ts-expect-error TS18047
expect(root.classList.contains('sg-actions-list')).toEqual(true);
});
@@ -25,6 +26,7 @@ describe('ActionList', () => {
const actionList = render();
const root = actionList.container.firstElementChild;
+ // @ts-expect-error TS18047
expect(root.classList.contains('sg-actions-list--to-right')).toEqual(true);
});
@@ -32,6 +34,7 @@ describe('ActionList', () => {
const actionList = render();
const root = actionList.container.firstElementChild;
+ // @ts-expect-error TS18047
expect(root.classList.contains('sg-actions-list--to-top')).toEqual(true);
});
@@ -39,6 +42,7 @@ describe('ActionList', () => {
const actionList = render();
const root = actionList.container.firstElementChild;
+ // @ts-expect-error TS18047
expect(root.classList.contains('sg-actions-list--align-baseline')).toEqual(
true
);
@@ -48,6 +52,7 @@ describe('ActionList', () => {
const actionList = render();
const root = actionList.container.firstElementChild;
+ // @ts-expect-error TS18047
expect(root.classList.contains('sg-actions-list--centered')).toEqual(true);
});
@@ -57,6 +62,7 @@ describe('ActionList', () => {
);
const root = actionList.container.firstElementChild;
+ // @ts-expect-error TS18047
expect(root.classList.contains('sg-actions-list--space-between')).toEqual(
true
);
@@ -68,6 +74,7 @@ describe('ActionList', () => {
);
const root = actionList.container.firstElementChild;
+ // @ts-expect-error TS18047
expect(root.classList.contains('sg-actions-list--space-around')).toEqual(
true
);
@@ -79,6 +86,7 @@ describe('ActionList', () => {
);
const root = actionList.container.firstElementChild;
+ // @ts-expect-error TS18047
expect(root.classList.contains('sg-actions-list--space-evenly')).toEqual(
true
);
@@ -88,6 +96,7 @@ describe('ActionList', () => {
const actionList = render();
const root = actionList.container.firstElementChild;
+ // @ts-expect-error TS18047
expect(root.classList.contains('sg-actions-list--no-wrap')).toEqual(true);
});
});
diff --git a/src/components/action-list/ActionListHole.spec.tsx b/src/components/action-list/ActionListHole.spec.tsx
index 753b9dea6d..fcb95c1566 100644
--- a/src/components/action-list/ActionListHole.spec.tsx
+++ b/src/components/action-list/ActionListHole.spec.tsx
@@ -14,6 +14,7 @@ describe('', () => {
);
expect(
+ // @ts-expect-error TS18047
actionListHole.container.firstElementChild.classList.contains(
'sg-actions-list__hole'
)
@@ -26,6 +27,7 @@ describe('', () => {
);
expect(
+ // @ts-expect-error TS18047
actionListHole.container.firstElementChild.classList.contains(
'sg-actions-list__hole--container'
)
@@ -37,6 +39,7 @@ describe('', () => {
);
expect(
+ // @ts-expect-error TS18047
actionListHole.container.firstElementChild.classList.contains(
'sg-actions-list__hole--no-spacing'
)
@@ -48,6 +51,7 @@ describe('', () => {
);
expect(
+ // @ts-expect-error TS18047
actionListHole.container.firstElementChild.classList.contains(
'sg-actions-list__hole--space-bellow'
)
@@ -59,6 +63,7 @@ describe('', () => {
);
expect(
+ // @ts-expect-error TS18047
actionListHole.container.firstElementChild.classList.contains(
'sg-actions-list__hole--no-shrink'
)
@@ -68,6 +73,7 @@ describe('', () => {
const actionListHole = render(test);
expect(
+ // @ts-expect-error TS18047
actionListHole.container.firstElementChild.classList.contains(
'sg-actions-list__hole--grow'
)
@@ -77,6 +83,7 @@ describe('', () => {
const actionListHole = render(test);
expect(
+ // @ts-expect-error TS18047
actionListHole.container.firstElementChild.classList.contains(
'sg-actions-list__hole--to-end'
)
@@ -88,6 +95,7 @@ describe('', () => {
);
expect(
+ // @ts-expect-error TS18047
actionListHole.container.firstElementChild.classList.contains(
'sg-actions-list__hole--to-right'
)
@@ -99,6 +107,7 @@ describe('', () => {
);
expect(
+ // @ts-expect-error TS18047
actionListHole.container.firstElementChild.classList.contains(
'sg-actions-list__hole--to-right'
)
@@ -112,6 +121,7 @@ describe('', () => {
);
expect(
+ // @ts-expect-error TS18047
actionListHole.container.firstElementChild.classList.contains(
'sg-actions-list__hole--spaced-small'
)
@@ -125,6 +135,7 @@ describe('', () => {
);
expect(
+ // @ts-expect-error TS18047
actionListHole.container.firstElementChild.classList.contains(
'sg-actions-list__hole--spaced-xsmall'
)
@@ -136,6 +147,7 @@ describe('', () => {
);
expect(
+ // @ts-expect-error TS18047
actionListHole.container.firstElementChild.classList.contains(
'sg-actions-list__hole--equal-width'
)
diff --git a/src/components/box/Box.chromatic.stories.tsx b/src/components/box/Box.chromatic.stories.tsx
index 202d986fe6..99d9f80d96 100644
--- a/src/components/box/Box.chromatic.stories.tsx
+++ b/src/components/box/Box.chromatic.stories.tsx
@@ -6,6 +6,7 @@ import {
responsivePropsStoryLabel,
} from '../../chromatic/utils';
+// @ts-expect-error TS7006
export const ResponsiveProps = args => {
return (
diff --git a/src/components/buttons/Button.tsx b/src/components/buttons/Button.tsx
index 3cf286606f..b3a220bfea 100644
--- a/src/components/buttons/Button.tsx
+++ b/src/components/buttons/Button.tsx
@@ -369,6 +369,7 @@ const Button = React.forwardRef(
ico =
{icon};
}
+ // @ts-expect-error TS7006
const onButtonClick = e => {
if (isLink && isDisabled) {
return;
diff --git a/src/components/buttons/ButtonLite.tsx b/src/components/buttons/ButtonLite.tsx
index 4520aa70ad..4b89a1dd01 100644
--- a/src/components/buttons/ButtonLite.tsx
+++ b/src/components/buttons/ButtonLite.tsx
@@ -217,6 +217,7 @@ const ButtonLite = ({
);
}
+ // @ts-expect-error TS7006
const onButtonClick = e => {
if (isLink && isDisabled) {
return;
diff --git a/src/components/card-interactive/CardCheckbox.tsx b/src/components/card-interactive/CardCheckbox.tsx
index 1257ae9fee..c14d34dbdd 100644
--- a/src/components/card-interactive/CardCheckbox.tsx
+++ b/src/components/card-interactive/CardCheckbox.tsx
@@ -168,6 +168,7 @@ export const CardCheckboxRoot = React.forwardRef<
};
const onInputChange = React.useCallback(
+ // @ts-expect-error TS7006
e => {
if (!isControlled) {
setIsChecked(val => !val);
@@ -188,7 +189,9 @@ export const CardCheckboxRoot = React.forwardRef<
diff --git a/src/components/card-interactive/CardRadio.tsx b/src/components/card-interactive/CardRadio.tsx
index 1d9235f9f3..b9bf0df330 100644
--- a/src/components/card-interactive/CardRadio.tsx
+++ b/src/components/card-interactive/CardRadio.tsx
@@ -153,6 +153,7 @@ const CardRadio = React.forwardRef(
diff --git a/src/components/chip/Chip.tsx b/src/components/chip/Chip.tsx
index 0ffaea919b..37bcabf1b0 100644
--- a/src/components/chip/Chip.tsx
+++ b/src/components/chip/Chip.tsx
@@ -151,9 +151,11 @@ const Chip = ({
const isControlled = checked !== undefined || isWithinChipGroup;
const isChecked = isControlled
- ? checked ?? isCheckedWithinGroup(chipGroupContext.groupValue, value)
+ ? // @ts-expect-error TS2345
+ checked ?? isCheckedWithinGroup(chipGroupContext.groupValue, value)
: undefined;
+ // @ts-expect-error TS7006
const onInputChange = e => {
if (isWithinChipGroup) {
chipGroupContext.onChipChange(e, value);
diff --git a/src/components/chip/ChipGroup.spec.tsx b/src/components/chip/ChipGroup.spec.tsx
index 68ff811238..05ee0ce071 100644
--- a/src/components/chip/ChipGroup.spec.tsx
+++ b/src/components/chip/ChipGroup.spec.tsx
@@ -8,6 +8,7 @@ import {testA11y} from '../../axe';
const chips = ['option-a', 'option-b'];
describe('', () => {
+ // @ts-expect-error TS7006
const renderChipGroup = props =>
render(
diff --git a/src/components/chip/ChipGroup.tsx b/src/components/chip/ChipGroup.tsx
index be63f852b5..8673754fd0 100644
--- a/src/components/chip/ChipGroup.tsx
+++ b/src/components/chip/ChipGroup.tsx
@@ -92,6 +92,7 @@ const getGroupValue = (
) => {
if (multiSelect) {
if (Array.isArray(currentValue)) {
+ // @ts-expect-error TS2345
return currentValue.includes(toggledValue)
? currentValue.filter(v => v !== toggledValue)
: [...currentValue, toggledValue];
@@ -122,10 +123,13 @@ const ChipGroup = ({
const [selectedValue, setSelectedValue] = React.useState(value || null);
React.useEffect(() => {
+ // @ts-expect-error TS2345
setSelectedValue(value);
}, [value]);
+ // @ts-expect-error TS7006
const setValue = (event, chipValue) => {
+ // @ts-expect-error TS2345
setSelectedValue(getGroupValue(selectedValue, chipValue, multiSelect));
if (onChange) onChange(event, chipValue);
};
diff --git a/src/components/colors/hex.spec.ts b/src/components/colors/hex.spec.ts
index 131aa269bd..f9c51a2a5d 100644
--- a/src/components/colors/hex.spec.ts
+++ b/src/components/colors/hex.spec.ts
@@ -1,3 +1,4 @@
+// @ts-expect-error TS7016
import colors from './colors';
import hex from './hex';
diff --git a/src/components/colors/hex.ts b/src/components/colors/hex.ts
index fa039926c5..e83a9d7de4 100644
--- a/src/components/colors/hex.ts
+++ b/src/components/colors/hex.ts
@@ -1,8 +1,10 @@
+// @ts-expect-error TS7016
import colors from './colors';
const hex: Record = {};
Object.keys(colors).forEach(groupName => {
+ // @ts-expect-error TS7006
colors[groupName].forEach(color => {
hex[color.variable.slice(1)] = `#${color.hex}`;
});
diff --git a/src/components/content-box/ContentBox.spec.tsx b/src/components/content-box/ContentBox.spec.tsx
index 31034f50d1..830d9a827b 100644
--- a/src/components/content-box/ContentBox.spec.tsx
+++ b/src/components/content-box/ContentBox.spec.tsx
@@ -7,6 +7,7 @@ describe('', () => {
const contentBox = render(test);
expect(
+ // @ts-expect-error TS18047
contentBox.container.firstElementChild.classList.contains(
'sg-content-box'
)
@@ -16,6 +17,7 @@ describe('', () => {
const contentBox = render(test);
expect(
+ // @ts-expect-error TS18047
contentBox.container.firstElementChild.classList.contains(
'sg-content-box--full'
)
@@ -26,11 +28,13 @@ describe('', () => {
const contentBox2 = render(test);
expect(
+ // @ts-expect-error TS18047
contentBox.container.firstElementChild.classList.contains(
'sg-content-box--spaced'
)
).toEqual(true);
expect(
+ // @ts-expect-error TS18047
contentBox2.container.firstElementChild.classList.contains(
'sg-content-box--spaced-small'
)
@@ -44,11 +48,13 @@ describe('', () => {
);
expect(
+ // @ts-expect-error TS18047
testBox.container.firstElementChild.classList.contains(
'sg-content-box--spaced-bottom'
)
).toEqual(true);
expect(
+ // @ts-expect-error TS18047
testBox.container.firstElementChild.classList.contains(
'sg-content-box--spaced-bottom-normal'
)
@@ -62,6 +68,7 @@ describe('', () => {
);
expect(
+ // @ts-expect-error TS18047
testBox.container.firstElementChild.classList.contains(
'sg-content-box--spaced-bottom-xsmall'
)
@@ -73,11 +80,13 @@ describe('', () => {
);
expect(
+ // @ts-expect-error TS18047
testBox.container.firstElementChild.classList.contains(
'sg-content-box--spaced-top'
)
).toEqual(true);
expect(
+ // @ts-expect-error TS18047
testBox.container.firstElementChild.classList.contains(
'sg-content-box--spaced-top-normal'
)
@@ -89,6 +98,7 @@ describe('', () => {
);
expect(
+ // @ts-expect-error TS18047
testBox.container.firstElementChild.classList.contains(
'sg-content-box--spaced-top-xsmall'
)
diff --git a/src/components/content-box/ContentBoxActions.spec.tsx b/src/components/content-box/ContentBoxActions.spec.tsx
index c564eff086..e0b8149059 100644
--- a/src/components/content-box/ContentBoxActions.spec.tsx
+++ b/src/components/content-box/ContentBoxActions.spec.tsx
@@ -8,6 +8,7 @@ describe('', () => {
const testBox = render(test);
expect(
+ // @ts-expect-error TS18047
testBox.container.firstElementChild.classList.contains(
'sg-content-box__actions'
)
@@ -20,6 +21,7 @@ describe('', () => {
);
expect(
+ // @ts-expect-error TS18047
testBox.container.firstElementChild.classList.contains(
'sg-content-box__actions--with-centered-elements'
)
@@ -32,6 +34,7 @@ describe('', () => {
);
expect(
+ // @ts-expect-error TS18047
testBox.container.firstElementChild.classList.contains(
'sg-content-box__actions--with-elements-to-right'
)
@@ -44,6 +47,7 @@ describe('', () => {
);
expect(
+ // @ts-expect-error TS18047
testBox.container.firstElementChild.classList.contains(
'sg-content-box__actions--spaced-top-xsmall'
)
@@ -56,6 +60,7 @@ describe('', () => {
);
expect(
+ // @ts-expect-error TS18047
testBox.container.firstElementChild.classList.contains(
'sg-content-box__actions--spaced-bottom-xsmall'
)
diff --git a/src/components/content-box/ContentBoxContent.spec.tsx b/src/components/content-box/ContentBoxContent.spec.tsx
index 3d88b62d47..3f71cf8b6e 100644
--- a/src/components/content-box/ContentBoxContent.spec.tsx
+++ b/src/components/content-box/ContentBoxContent.spec.tsx
@@ -8,6 +8,7 @@ describe('', () => {
const testBox = render(test);
expect(
+ // @ts-expect-error TS18047
testBox.container.firstElementChild.classList.contains(
'sg-content-box__content'
)
@@ -17,6 +18,7 @@ describe('', () => {
const testBox = render(test);
expect(
+ // @ts-expect-error TS18047
testBox.container.firstElementChild.classList.contains(
'sg-content-box__content--full'
)
@@ -28,6 +30,7 @@ describe('', () => {
);
expect(
+ // @ts-expect-error TS18047
testBox.container.firstElementChild.classList.contains(
'sg-content-box__content--with-elements-to-right'
)
@@ -39,6 +42,7 @@ describe('', () => {
);
expect(
+ // @ts-expect-error TS18047
testBox.container.firstElementChild.classList.contains(
'sg-content-box__content--with-centered-text'
)
@@ -50,11 +54,13 @@ describe('', () => {
);
expect(
+ // @ts-expect-error TS18047
testBox.container.firstElementChild.classList.contains(
'sg-content-box__content--spaced-top'
)
).toBeTruthy();
expect(
+ // @ts-expect-error TS18047
testBox.container.firstElementChild.classList.contains(
'sg-content-box__content--spaced-top-normal'
)
@@ -66,6 +72,7 @@ describe('', () => {
);
expect(
+ // @ts-expect-error TS18047
testBox.container.firstElementChild.classList.contains(
'sg-content-box__content--spaced-top-xsmall'
)
@@ -77,11 +84,13 @@ describe('', () => {
);
expect(
+ // @ts-expect-error TS18047
testBox.container.firstElementChild.classList.contains(
'sg-content-box__content--spaced-bottom'
)
).toBeTruthy();
expect(
+ // @ts-expect-error TS18047
testBox.container.firstElementChild.classList.contains(
'sg-content-box__content--spaced-bottom-normal'
)
@@ -93,6 +102,7 @@ describe('', () => {
);
expect(
+ // @ts-expect-error TS18047
testBox.container.firstElementChild.classList.contains(
'sg-content-box__content--spaced-bottom-xsmall'
)
diff --git a/src/components/content-box/ContentBoxHeader.spec.tsx b/src/components/content-box/ContentBoxHeader.spec.tsx
index fff2edfc4c..485f19d4e0 100644
--- a/src/components/content-box/ContentBoxHeader.spec.tsx
+++ b/src/components/content-box/ContentBoxHeader.spec.tsx
@@ -8,6 +8,7 @@ describe('', () => {
const testBox = render(test);
expect(
+ // @ts-expect-error TS18047
testBox.container.firstElementChild.classList.contains(
'sg-content-box__header'
)
@@ -19,6 +20,7 @@ describe('', () => {
);
expect(
+ // @ts-expect-error TS18047
testBox.container.firstElementChild.classList.contains(
'sg-content-box__header--with-centered-elements'
)
@@ -31,11 +33,13 @@ describe('', () => {
);
expect(
+ // @ts-expect-error TS18047
testBox.container.firstElementChild.classList.contains(
'sg-content-box__header--spaced'
)
).toEqual(true);
expect(
+ // @ts-expect-error TS18047
testBox2.container.firstElementChild.classList.contains(
'sg-content-box__header--spaced-small'
)
@@ -47,11 +51,13 @@ describe('', () => {
);
expect(
+ // @ts-expect-error TS18047
testBox.container.firstElementChild.classList.contains(
'sg-content-box__header--spaced-top'
)
).toBeTruthy();
expect(
+ // @ts-expect-error TS18047
testBox.container.firstElementChild.classList.contains(
'sg-content-box__header--spaced-top-normal'
)
@@ -63,6 +69,7 @@ describe('', () => {
);
expect(
+ // @ts-expect-error TS18047
testBox.container.firstElementChild.classList.contains(
'sg-content-box__header--spaced-top-xsmall'
)
@@ -74,11 +81,13 @@ describe('', () => {
);
expect(
+ // @ts-expect-error TS18047
testBox.container.firstElementChild.classList.contains(
'sg-content-box__header--spaced-bottom'
)
).toBeTruthy();
expect(
+ // @ts-expect-error TS18047
testBox.container.firstElementChild.classList.contains(
'sg-content-box__header--spaced-bottom-normal'
)
@@ -90,6 +99,7 @@ describe('', () => {
);
expect(
+ // @ts-expect-error TS18047
testBox.container.firstElementChild.classList.contains(
'sg-content-box__header--spaced-bottom-xsmall'
)
diff --git a/src/components/content-box/ContentBoxTitle.spec.tsx b/src/components/content-box/ContentBoxTitle.spec.tsx
index 14e4b61b9f..6440ed4e87 100644
--- a/src/components/content-box/ContentBoxTitle.spec.tsx
+++ b/src/components/content-box/ContentBoxTitle.spec.tsx
@@ -8,6 +8,7 @@ describe('', () => {
const testBox = render(test);
expect(
+ // @ts-expect-error TS18047
testBox.container.firstElementChild.classList.contains(
'sg-content-box__title'
)
@@ -19,6 +20,7 @@ describe('', () => {
);
expect(
+ // @ts-expect-error TS18047
testBox.container.firstElementChild.classList.contains(
'sg-content-box__title--with-centered-elements'
)
@@ -31,11 +33,13 @@ describe('', () => {
);
expect(
+ // @ts-expect-error TS18047
testBox.container.firstElementChild.classList.contains(
'sg-content-box__title--spaced'
)
).toEqual(true);
expect(
+ // @ts-expect-error TS18047
testBox2.container.firstElementChild.classList.contains(
'sg-content-box__title--spaced-small'
)
@@ -47,11 +51,13 @@ describe('', () => {
);
expect(
+ // @ts-expect-error TS18047
testBox.container.firstElementChild.classList.contains(
'sg-content-box__title--spaced-top'
)
).toBeTruthy();
expect(
+ // @ts-expect-error TS18047
testBox.container.firstElementChild.classList.contains(
'sg-content-box__title--spaced-top-normal'
)
@@ -63,6 +69,7 @@ describe('', () => {
);
expect(
+ // @ts-expect-error TS18047
testBox.container.firstElementChild.classList.contains(
'sg-content-box__title--spaced-top-xsmall'
)
@@ -74,11 +81,13 @@ describe('', () => {
);
expect(
+ // @ts-expect-error TS18047
testBox.container.firstElementChild.classList.contains(
'sg-content-box__title--spaced-bottom'
)
).toBeTruthy();
expect(
+ // @ts-expect-error TS18047
testBox.container.firstElementChild.classList.contains(
'sg-content-box__title--spaced-bottom-normal'
)
@@ -90,6 +99,7 @@ describe('', () => {
);
expect(
+ // @ts-expect-error TS18047
testBox.container.firstElementChild.classList.contains(
'sg-content-box__title--spaced-bottom-xsmall'
)
diff --git a/src/components/counters/Counter.tsx b/src/components/counters/Counter.tsx
index 0d2c5700e8..69b8e1153f 100644
--- a/src/components/counters/Counter.tsx
+++ b/src/components/counters/Counter.tsx
@@ -147,8 +147,10 @@ const Counter = ({
}: CounterPropsType) => {
const backgroundColor =
variant === 'solid'
- ? SOLID_COLOR_BACKGROUND_MAP[color]
- : LIGHT_COLOR_BACKGROUND_MAP[color];
+ ? // @ts-expect-error TS2538
+ SOLID_COLOR_BACKGROUND_MAP[color]
+ : // @ts-expect-error TS2538
+ LIGHT_COLOR_BACKGROUND_MAP[color];
const counterClass = cx(
'sg-counter',
{
@@ -161,6 +163,7 @@ const Counter = ({
);
const textColor =
+ // @ts-expect-error TS2538
variant === 'solid' ? SOLID_COLOR_TEXT_MAP[color] : 'text-black';
let content;
diff --git a/src/components/dialog/Dialog.spec.tsx b/src/components/dialog/Dialog.spec.tsx
index 84bbf7ac2b..d017ed5697 100644
--- a/src/components/dialog/Dialog.spec.tsx
+++ b/src/components/dialog/Dialog.spec.tsx
@@ -30,6 +30,7 @@ describe('
);
+ // @ts-expect-error TS2345
fireEvent.keyUp(wrapper.container.firstChild, {
key: 'Escape',
});
@@ -44,6 +45,7 @@ describe('
);
+ // @ts-expect-error TS2345
fireEvent.click(wrapper.container.firstChild);
expect(onDismiss).toHaveBeenCalledTimes(1);
});
diff --git a/src/components/dialog/useBodyNoScroll.ts b/src/components/dialog/useBodyNoScroll.ts
index 8ce076d98e..11dfa22d6f 100644
--- a/src/components/dialog/useBodyNoScroll.ts
+++ b/src/components/dialog/useBodyNoScroll.ts
@@ -6,6 +6,7 @@ const DIALOG_SELECTOR = '.js-dialog';
export function useBodyNoScroll(overlayRef: {current: HTMLDivElement | null}) {
const cleanupRef = React.useRef(null);
const forceCleanup = React.useCallback(() => {
+ // @ts-expect-error TS2349
if (cleanupRef.current) cleanupRef.current();
}, []);
@@ -35,6 +36,7 @@ export function useBodyNoScroll(overlayRef: {current: HTMLDivElement | null}) {
const dialogsOpenCount =
document.querySelectorAll(DIALOG_SELECTOR).length;
const nestedOpenDialogsCount =
+ // @ts-expect-error TS2532
overlayRef.current?.querySelectorAll(DIALOG_SELECTOR).length | 0;
// nested dialogs shouldn't be counted
@@ -53,6 +55,7 @@ export function useBodyNoScroll(overlayRef: {current: HTMLDivElement | null}) {
window.scrollTo(0, scrollY);
};
+ // @ts-expect-error TS2322
cleanupRef.current = cleanup;
return cleanup;
}, [overlayRef]);
diff --git a/src/components/dialog/useFocusTrap.ts b/src/components/dialog/useFocusTrap.ts
index 92c301de83..162a5f10ae 100644
--- a/src/components/dialog/useFocusTrap.ts
+++ b/src/components/dialog/useFocusTrap.ts
@@ -35,11 +35,13 @@ export function useFocusTrap({
function handleFocusTrap(event: FocusEvent) {
if (
event.target instanceof Node &&
+ // @ts-expect-error TS18047
dialogElement.contains(event.target)
) {
return;
}
+ // @ts-expect-error TS2345
focusDescendant(dialogElement, isTabbingForward);
}
diff --git a/src/components/dropdowns/Dropdown.spec.tsx b/src/components/dropdowns/Dropdown.spec.tsx
index c62751c2e6..9d2d554635 100644
--- a/src/components/dropdowns/Dropdown.spec.tsx
+++ b/src/components/dropdowns/Dropdown.spec.tsx
@@ -31,6 +31,7 @@ describe('', () => {
it('should render links with proper data', () => {
const component = render();
+ // @ts-expect-error TS2345
fireEvent.click(component.container.firstElementChild);
expect(component.getAllByRole('link')[0].getAttribute('href')).toEqual(
@@ -47,6 +48,7 @@ describe('', () => {
it('should open dropdown on click', () => {
const component = render();
+ // @ts-expect-error TS2345
fireEvent.click(component.container.firstElementChild);
expect(component.getAllByRole('link')).toHaveLength(3);
});
@@ -54,6 +56,7 @@ describe('', () => {
it('should close dropdown when click outside', () => {
const component = render();
+ // @ts-expect-error TS2345
fireEvent.click(component.container.firstElementChild);
expect(component.getAllByRole('link')).toHaveLength(3);
@@ -67,6 +70,7 @@ describe('', () => {
);
+ // @ts-expect-error TS2345
fireEvent.click(component.container.firstElementChild);
const link = component.getAllByRole('link')[0];
diff --git a/src/components/flex/Flex.chromatic.stories.tsx b/src/components/flex/Flex.chromatic.stories.tsx
index 5fe8f44f56..7ac3439264 100644
--- a/src/components/flex/Flex.chromatic.stories.tsx
+++ b/src/components/flex/Flex.chromatic.stories.tsx
@@ -20,6 +20,7 @@ const indigoBoxStyle = {
color: COLOR['indigo-20'],
};
+// @ts-expect-error TS7006
export const ResponsiveProps = args => {
return (
diff --git a/src/components/form-elements/Input.tsx b/src/components/form-elements/Input.tsx
index 7662aeac74..582fb46ffb 100644
--- a/src/components/form-elements/Input.tsx
+++ b/src/components/form-elements/Input.tsx
@@ -199,7 +199,9 @@ const Input = (props: InputPropsType) => {
{
});
it('Type', () => {
+ // @ts-expect-error TS7006
const CustomTextarea = props => (