chore: Disallow some more footguns with eslint

This commit is contained in:
Sören Beye 2023-12-03 19:18:00 +01:00
parent eeac70466f
commit 9d9213c84e
10 changed files with 20 additions and 15 deletions

View File

@ -42,6 +42,11 @@
"no-whitespace-before-property": "error",
"no-magic-numbers": ["off", { "ignoreArrayIndexes": true }],
"no-unused-vars": ["warn", { "args": "none" }],
"object-shorthand": ["error", "never"],
"no-restricted-syntax": [
"error",
"[generator=true]"
],
"jsdoc/check-alignment": "error",
"jsdoc/check-param-names": "error",
"jsdoc/check-tag-names": "error",

View File

@ -13,7 +13,7 @@ class MockTotalStatisticsCapability extends TotalStatisticsCapability {
this.totalStatistics = {
time: count * 24 * 60,
area: count * 63 * 10000,
count
count: count
};
}

View File

@ -29,10 +29,10 @@ module.exports = function(options) {
}
res.sse = {
write(data) {
write: (data) => {
write(data);
},
terminate() {
terminate: () => {
res.end();
res.socket?.destroy();
}

View File

@ -1283,7 +1283,7 @@ export const useUpdaterCommandMutation = () => {
return useMutation({
mutationFn: sendUpdaterCommand,
onError: useOnCommandError("Updater"),
onSuccess() {
onSuccess: () => {
refetchUpdaterState().catch(() => {/*intentional*/});
}
});
@ -1342,7 +1342,7 @@ export const useSetQuirkValueMutation = () => {
return useMutation({
mutationFn: sendSetQuirkValueCommand,
onError: useOnCommandError(Capability.Quirks),
onSuccess() {
onSuccess: () => {
refetchQuirksState().catch(() => {/*intentional*/});
}
});

View File

@ -10,7 +10,7 @@ const LoadingFade: FunctionComponent<{ in?: boolean, transitionDelay?: string, s
<Fade
in={fadeIn}
style={{
transitionDelay,
transitionDelay: transitionDelay,
}}
unmountOnExit
>

View File

@ -57,7 +57,7 @@ const ValetudoEvents = (): React.ReactElement => {
<EventControl event={event} interact={(interaction) => {
interactWithEvent({
id: event.id,
interaction
interaction: interaction
});
}}/>
</React.Fragment>

View File

@ -468,7 +468,7 @@ abstract class Map<P, S> extends React.Component<P & MapProps, S & MapState > {
const result = structure.translate(
this.touchHandlingState.dragStart.matrixTransform(invertedCurrentTransform),
{x: oldX, y: oldY},
{x, y},
{x: x, y: y},
currentTransform,
currentPixelSize
);

View File

@ -160,9 +160,9 @@ const AuthSettings = (): React.ReactElement => {
disabled={!configurationModified}
onClick={() => {
updateConfiguration({
enabled,
username,
password
enabled: enabled,
username: username,
password: password
});
setConfigurationModified(false);
}}

View File

@ -271,9 +271,9 @@ const NTPConnectivity = (): React.ReactElement => {
disabled={!configurationModified}
onClick={() => {
updateConfiguration({
enabled,
server,
port,
enabled: enabled,
server: server,
port: port,
interval: ntpInterval,
timeout: ntpTimeout
});

View File

@ -122,7 +122,7 @@ const NetworkAdvertisementSettings = (): React.ReactElement => {
disabled={!configurationModified}
onClick={() => {
updateConfiguration({
enabled
enabled: enabled
});
setConfigurationModified(false);
}}