Skip to content

Virtual whiteboard for sketching hand-drawn like diagrams

remove eslint two disabled rules & fix (#2309)

David Luzar56215c6c2bcf
diff --git a/.eslintrc.json b/.eslintrc.json
index 0c5c0a88d8..c53d24e231 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -2,8 +2,6 @@
"extends": ["prettier", "react-app", "react-app/jest"],
"plugins": ["prettier"],
"rules": {
- "@typescript-eslint/no-unused-vars": "off",
- "@typescript-eslint/no-redeclare": "off",
"import/no-anonymous-default-export": "off",
"curly": "warn",
"no-console": [
diff --git a/src/components/ContextMenu.tsx b/src/components/ContextMenu.tsx
index f8292c8534..335f96a0d6 100644
--- a/src/components/ContextMenu.tsx
+++ b/src/components/ContextMenu.tsx
@@ -38,9 +38,11 @@ const ContextMenu = ({ options, onCloseRequest, top, left }: Props) => {
className="context-menu"
onContextMenu={(event) => event.preventDefault()}
>
- {options.map((option, idx) => (
+ {options.map(({ action, label }, idx) => (
<li key={idx} onClick={onCloseRequest}>
- <ContextMenuOption {...option} />
+ <button className="context-menu-option" onClick={action}>
+ {label}
+ </button>
</li>
))}
</ul>
@@ -49,12 +51,6 @@ const ContextMenu = ({ options, onCloseRequest, top, left }: Props) => {
);
};
-const ContextMenuOption = ({ label, action }: ContextMenuOption) => (
- <button className="context-menu-option" onClick={action}>
- {label}
- </button>
-);
-
let contextMenuNode: HTMLDivElement;
const getContextMenuNode = (): HTMLDivElement => {
if (contextMenuNode) {
diff --git a/src/global.d.ts b/src/global.d.ts
index 193a78a84a..c72b46e468 100644
--- a/src/global.d.ts
+++ b/src/global.d.ts
@@ -1,3 +1,4 @@
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
interface Document {
fonts?: {
ready?: Promise<void>;