mirror of
https://github.com/Hypfer/Valetudo.git
synced 2025-10-26 11:27:27 +00:00
chore: Disallow some more footguns with eslint
This commit is contained in:
parent
eeac70466f
commit
9d9213c84e
@ -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",
|
||||
|
||||
@ -13,7 +13,7 @@ class MockTotalStatisticsCapability extends TotalStatisticsCapability {
|
||||
this.totalStatistics = {
|
||||
time: count * 24 * 60,
|
||||
area: count * 63 * 10000,
|
||||
count
|
||||
count: count
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -29,10 +29,10 @@ module.exports = function(options) {
|
||||
}
|
||||
|
||||
res.sse = {
|
||||
write(data) {
|
||||
write: (data) => {
|
||||
write(data);
|
||||
},
|
||||
terminate() {
|
||||
terminate: () => {
|
||||
res.end();
|
||||
res.socket?.destroy();
|
||||
}
|
||||
|
||||
@ -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*/});
|
||||
}
|
||||
});
|
||||
|
||||
@ -10,7 +10,7 @@ const LoadingFade: FunctionComponent<{ in?: boolean, transitionDelay?: string, s
|
||||
<Fade
|
||||
in={fadeIn}
|
||||
style={{
|
||||
transitionDelay,
|
||||
transitionDelay: transitionDelay,
|
||||
}}
|
||||
unmountOnExit
|
||||
>
|
||||
|
||||
@ -57,7 +57,7 @@ const ValetudoEvents = (): React.ReactElement => {
|
||||
<EventControl event={event} interact={(interaction) => {
|
||||
interactWithEvent({
|
||||
id: event.id,
|
||||
interaction
|
||||
interaction: interaction
|
||||
});
|
||||
}}/>
|
||||
</React.Fragment>
|
||||
|
||||
@ -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
|
||||
);
|
||||
|
||||
@ -160,9 +160,9 @@ const AuthSettings = (): React.ReactElement => {
|
||||
disabled={!configurationModified}
|
||||
onClick={() => {
|
||||
updateConfiguration({
|
||||
enabled,
|
||||
username,
|
||||
password
|
||||
enabled: enabled,
|
||||
username: username,
|
||||
password: password
|
||||
});
|
||||
setConfigurationModified(false);
|
||||
}}
|
||||
|
||||
@ -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
|
||||
});
|
||||
|
||||
@ -122,7 +122,7 @@ const NetworkAdvertisementSettings = (): React.ReactElement => {
|
||||
disabled={!configurationModified}
|
||||
onClick={() => {
|
||||
updateConfiguration({
|
||||
enabled
|
||||
enabled: enabled
|
||||
});
|
||||
setConfigurationModified(false);
|
||||
}}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user