remove eslint two disabled rules & fix (#2309)

This commit is contained in:
David Luzar 2020-10-28 20:53:27 +01:00 committed by GitHub
parent fc58e51ab3
commit 56215c6c2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 10 deletions

View File

@ -2,8 +2,6 @@
"extends": ["prettier", "react-app", "react-app/jest"], "extends": ["prettier", "react-app", "react-app/jest"],
"plugins": ["prettier"], "plugins": ["prettier"],
"rules": { "rules": {
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-redeclare": "off",
"import/no-anonymous-default-export": "off", "import/no-anonymous-default-export": "off",
"curly": "warn", "curly": "warn",
"no-console": [ "no-console": [

View File

@ -38,9 +38,11 @@ const ContextMenu = ({ options, onCloseRequest, top, left }: Props) => {
className="context-menu" className="context-menu"
onContextMenu={(event) => event.preventDefault()} onContextMenu={(event) => event.preventDefault()}
> >
{options.map((option, idx) => ( {options.map(({ action, label }, idx) => (
<li key={idx} onClick={onCloseRequest}> <li key={idx} onClick={onCloseRequest}>
<ContextMenuOption {...option} /> <button className="context-menu-option" onClick={action}>
{label}
</button>
</li> </li>
))} ))}
</ul> </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; let contextMenuNode: HTMLDivElement;
const getContextMenuNode = (): HTMLDivElement => { const getContextMenuNode = (): HTMLDivElement => {
if (contextMenuNode) { if (contextMenuNode) {

1
src/global.d.ts vendored
View File

@ -1,3 +1,4 @@
// eslint-disable-next-line @typescript-eslint/no-unused-vars
interface Document { interface Document {
fonts?: { fonts?: {
ready?: Promise<void>; ready?: Promise<void>;