Skip to content

Commit 5bd9166

Browse files
committed
Merge branch 'eslint-no-non-null-asserted-optional-chain' of Arnei/opencast-admin-interface into develop
Pull request #1350 Activate eslint no-non-null-asserted-optional-chain
2 parents 7e4ed34 + 565c6ed commit 5bd9166

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

eslint.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ export default [
2222
"@typescript-eslint/no-explicit-any": "off",
2323
"@typescript-eslint/no-floating-promises": "off",
2424
"@typescript-eslint/no-misused-promises": "off",
25-
"@typescript-eslint/no-non-null-asserted-optional-chain": "off",
2625
"@typescript-eslint/no-unsafe-argument": "off",
2726
"@typescript-eslint/no-unsafe-assignment": "off",
2827
"@typescript-eslint/no-unsafe-call": "off",

src/components/shared/Tooltip.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,14 @@ export const Tooltip = (
3939
areaRef.current?.getBoundingClientRect().width,
4040
0,
4141
);
42-
default:
43-
return areaRef.current?.getBoundingClientRect()!;
42+
default: {
43+
const rect = areaRef.current?.getBoundingClientRect();
44+
if (!rect) {
45+
return new DOMRect();
46+
} else {
47+
return rect;
48+
}
49+
}
4450
}
4551
};
4652

0 commit comments

Comments
 (0)