remove eslint two disabled rules & fix (#2309)
This commit is contained in:
parent
fc58e51ab3
commit
56215c6c2b
@ -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": [
|
||||
|
@ -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) {
|
||||
|
1
src/global.d.ts
vendored
1
src/global.d.ts
vendored
@ -1,3 +1,4 @@
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
interface Document {
|
||||
fonts?: {
|
||||
ready?: Promise<void>;
|
||||
|
Loading…
x
Reference in New Issue
Block a user