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"],
|
"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": [
|
||||||
|
@ -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
1
src/global.d.ts
vendored
@ -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>;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user