fix lint warnings

This commit is contained in:
Proddy
2023-04-22 10:05:13 +02:00
parent 19e8e4a7a1
commit 209afc87bb
19 changed files with 37 additions and 40 deletions

View File

@@ -49,7 +49,7 @@ const APSettingsForm: FC = () => {
try {
setFieldErrors(undefined);
await validate(createAPSettingsValidator(data), data);
saveData();
void saveData();
} catch (errors: any) {
setFieldErrors(errors);
}

View File

@@ -43,7 +43,7 @@ const MqttSettingsForm: FC = () => {
try {
setFieldErrors(undefined);
await validate(createMqttSettingsValidator(data), data);
saveData();
void saveData();
} catch (errors: any) {
setFieldErrors(errors);
}

View File

@@ -19,9 +19,11 @@ import {
} from '@mui/material';
import { useContext, useEffect, useState } from 'react';
import { toast } from 'react-toastify';
import type { FC} from 'react';
import RestartMonitor from '../system/RestartMonitor';
import { WiFiConnectionContext } from './WiFiConnectionContext';
import { isNetworkOpen, networkSecurityMode } from './WiFiNetworkSelector';
import type { ValidateFieldsError } from 'async-validator';
import type { FC } from 'react';
import type { NetworkSettings } from 'types';
import * as NetworkApi from 'api/network';
@@ -39,14 +41,9 @@ import { useI18nContext } from 'i18n/i18n-react';
import * as EMSESP from 'project/api';
import { numberValue, updateValueDirty, useRest } from 'utils';
import { WiFiConnectionContext } from './WiFiConnectionContext';
import { isNetworkOpen, networkSecurityMode } from './WiFiNetworkSelector';
import type { ValidateFieldsError } from 'async-validator';
import { validate } from 'validators';
import { createNetworkSettingsValidator } from 'validators/network';
import RestartMonitor from '../system/RestartMonitor';
const WiFiSettingsForm: FC = () => {
const { LL } = useI18nContext();
@@ -107,7 +104,7 @@ const WiFiSettingsForm: FC = () => {
try {
setFieldErrors(undefined);
await validate(createNetworkSettingsValidator(data), data);
saveData();
void saveData();
} catch (errors: any) {
setFieldErrors(errors);
}

View File

@@ -75,7 +75,7 @@ const WiFiNetworkScanner: FC = () => {
}, [finishedWithError, pollNetworkList, LL]);
useEffect(() => {
startNetworkScan();
void startNetworkScan();
}, [startNetworkScan]);
const renderNetworkScanner = () => {

View File

@@ -43,7 +43,7 @@ const NTPSettingsForm: FC = () => {
try {
setFieldErrors(undefined);
await validate(NTP_SETTINGS_VALIDATOR, data);
saveData();
void saveData();
} catch (errors: any) {
setFieldErrors(errors);
}

View File

@@ -90,7 +90,7 @@ const NTPStatusForm: FC = () => {
});
toast.success(LL.TIME_SET());
setSettingTime(false);
loadData();
void loadData();
} catch (error) {
toast.error(extractErrorMessage(error, LL.PROBLEM_UPDATING()));
} finally {

View File

@@ -42,7 +42,7 @@ const GenerateToken: FC<GenerateTokenProps> = ({ username, onClose }) => {
useEffect(() => {
if (open) {
getToken();
void getToken();
}
}, [open, getToken]);

View File

@@ -123,7 +123,7 @@ const ManageUsersForm: FC = () => {
const onSubmit = async () => {
await saveData();
authenticatedContext.refresh();
void authenticatedContext.refresh();
};
const user_table = data.users.map((u) => ({ ...u, id: u.username }));

View File

@@ -45,7 +45,7 @@ const OTASettingsForm: FC = () => {
try {
setFieldErrors(undefined);
await validate(OTA_SETTINGS_VALIDATOR, data);
saveData();
void saveData();
} catch (errors: any) {
setFieldErrors(errors);
}

View File

@@ -31,7 +31,7 @@ const RestartMonitor: FC = () => {
});
useEffect(() => {
poll.current();
void poll.current();
}, []);
useEffect(() => () => timeoutId && clearTimeout(timeoutId), [timeoutId]);

View File

@@ -117,7 +117,7 @@ const SystemLog: FC = () => {
...data,
level: parseInt(event.target.value)
});
sendSettings(data.max_messages, parseInt(event.target.value));
void sendSettings(data.max_messages, parseInt(event.target.value));
}
};
@@ -163,7 +163,7 @@ const SystemLog: FC = () => {
}, [LL]);
useEffect(() => {
fetchLog();
void fetchLog();
}, [fetchLog]);
useEffect(() => {

View File

@@ -1,16 +1,16 @@
import AppsIcon from '@mui/icons-material/Apps';
import RefreshIcon from '@mui/icons-material/Refresh';
import PowerSettingsNewIcon from '@mui/icons-material/PowerSettingsNew';
import SettingsBackupRestoreIcon from '@mui/icons-material/SettingsBackupRestore';
import BuildIcon from '@mui/icons-material/Build';
import TimerIcon from '@mui/icons-material/Timer';
import CancelIcon from '@mui/icons-material/Cancel';
import DevicesIcon from '@mui/icons-material/Devices';
import FolderIcon from '@mui/icons-material/Folder';
import MemoryIcon from '@mui/icons-material/Memory';
import PowerSettingsNewIcon from '@mui/icons-material/PowerSettingsNew';
import RefreshIcon from '@mui/icons-material/Refresh';
import SdCardAlertIcon from '@mui/icons-material/SdCardAlert';
import SdStorageIcon from '@mui/icons-material/SdStorage';
import SettingsBackupRestoreIcon from '@mui/icons-material/SettingsBackupRestore';
import ShowChartIcon from '@mui/icons-material/ShowChart';
import TimerIcon from '@mui/icons-material/Timer';
import {
Avatar,
Box,
@@ -34,11 +34,11 @@ import { toast } from 'react-toastify';
import RestartMonitor from './RestartMonitor';
import type { FC } from 'react';
import { useI18nContext } from 'i18n/i18n-react';
import type { SystemStatus, Version } from 'types';
import * as SystemApi from 'api/system';
import { ButtonRow, FormLoader, SectionContent, MessageBox } from 'components';
import { AuthenticatedContext } from 'contexts/authentication';
import { useI18nContext } from 'i18n/i18n-react';
import { extractErrorMessage, useRest } from 'utils';
export const VERSIONCHECK_ENDPOINT = 'https://api.github.com/repos/emsesp/EMS-ESP32/releases/latest';
@@ -64,14 +64,14 @@ const SystemStatusForm: FC = () => {
const [latestDevVersion, setLatestDevVersion] = useState<Version>();
useEffect(() => {
axios.get(VERSIONCHECK_ENDPOINT).then((response) => {
void axios.get(VERSIONCHECK_ENDPOINT).then((response) => {
setLatestVersion({
version: response.data.name,
url: response.data.assets[1].browser_download_url,
changelog: response.data.assets[0].browser_download_url
});
});
axios.get(VERSIONCHECK_DEV_ENDPOINT).then((response) => {
void axios.get(VERSIONCHECK_DEV_ENDPOINT).then((response) => {
setLatestDevVersion({
version: response.data.name.split(/\s+/).splice(-1),
url: response.data.assets[1].browser_download_url,