From 57351c27346d804b5b9c354da10961ca4fe9a88a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Mar 2022 08:32:18 +0000 Subject: build(deps-dev): Bump @typescript-eslint/eslint-plugin in /FrontEnd Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.12.1 to 5.14.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.14.0/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- FrontEnd/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FrontEnd/package.json b/FrontEnd/package.json index 1295295a..d839b670 100644 --- a/FrontEnd/package.json +++ b/FrontEnd/package.json @@ -56,7 +56,7 @@ "@types/react-responsive": "^8.0.5", "@types/react-transition-group": "^4.4.4", "@types/remarkable": "^2.0.3", - "@typescript-eslint/eslint-plugin": "^5.12.1", + "@typescript-eslint/eslint-plugin": "^5.14.0", "@typescript-eslint/parser": "^5.14.0", "@vitejs/plugin-react-refresh": "^1.3.6", "eslint": "^8.10.0", -- cgit v1.2.3 From ff046d001ba7b9ab784d2aa1a917536c56f23f8c Mon Sep 17 00:00:00 2001 From: crupest Date: Wed, 9 Mar 2022 16:36:35 +0800 Subject: Fix errors for eslint new rule. --- FrontEnd/src/i18n.ts | 4 ++-- FrontEnd/src/views/timeline-common/MarkdownPostEdit.tsx | 5 +++-- FrontEnd/src/views/timeline-common/TimelinePostEdit.tsx | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/FrontEnd/src/i18n.ts b/FrontEnd/src/i18n.ts index 5f71c7ea..6a38e5b4 100644 --- a/FrontEnd/src/i18n.ts +++ b/FrontEnd/src/i18n.ts @@ -4,7 +4,7 @@ import { initReactI18next } from "react-i18next"; const backend: BackendModule = { type: "backend", - async read(language, namespace, callback) { + read(language, namespace, callback) { function error(message: string): void { callback(new Error(message), false); } @@ -36,7 +36,7 @@ const backend: BackendModule = { })(); if (promise) { - success((await promise).default); + void promise.then((d) => success(d.default)); } }, init() {}, // eslint-disable-line @typescript-eslint/no-empty-function diff --git a/FrontEnd/src/views/timeline-common/MarkdownPostEdit.tsx b/FrontEnd/src/views/timeline-common/MarkdownPostEdit.tsx index 0eb9f53d..a3a8f408 100644 --- a/FrontEnd/src/views/timeline-common/MarkdownPostEdit.tsx +++ b/FrontEnd/src/views/timeline-common/MarkdownPostEdit.tsx @@ -1,4 +1,3 @@ -/* eslint-disable react/jsx-no-undef */ import React from "react"; import classnames from "classnames"; import { useTranslation } from "react-i18next"; @@ -118,7 +117,9 @@ const MarkdownPostEdit: React.FC = ({ } }} /> - {canSend && } + {canSend && ( + void send()} /> + )} ) } diff --git a/FrontEnd/src/views/timeline-common/TimelinePostEdit.tsx b/FrontEnd/src/views/timeline-common/TimelinePostEdit.tsx index f19f7785..cd61b4a7 100644 --- a/FrontEnd/src/views/timeline-common/TimelinePostEdit.tsx +++ b/FrontEnd/src/views/timeline-common/TimelinePostEdit.tsx @@ -254,7 +254,7 @@ const TimelinePostEdit: React.FC = (props) => { void onSend()} disabled={!canSend} loading={process} > -- cgit v1.2.3