From 56215c6c2bcf9f7f5e73a4a9c1c0fd129a95f295 Mon Sep 17 00:00:00 2001 From: David Luzar Date: Wed, 28 Oct 2020 20:53:27 +0100 Subject: [PATCH] remove eslint two disabled rules & fix (#2309) --- .eslintrc.json | 2 -- src/components/ContextMenu.tsx | 12 ++++-------- src/global.d.ts | 1 + 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 0c5c0a88..c53d24e2 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 f8292c85..335f96a0 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) => (
  • - +
  • ))} @@ -49,12 +51,6 @@ const ContextMenu = ({ options, onCloseRequest, top, left }: Props) => { ); }; -const ContextMenuOption = ({ label, action }: ContextMenuOption) => ( - -); - let contextMenuNode: HTMLDivElement; const getContextMenuNode = (): HTMLDivElement => { if (contextMenuNode) { diff --git a/src/global.d.ts b/src/global.d.ts index 193a78a8..c72b46e4 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;