Skip to content

Commit

Permalink
Removed final lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ajmcquilkin committed Jan 7, 2024
1 parent 5187625 commit fa26031
Show file tree
Hide file tree
Showing 30 changed files with 139 additions and 108 deletions.
5 changes: 3 additions & 2 deletions src/components/Map/CreateWaypointDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export const CreateWaypointDialog = ({
lngLat,
closeDialog,
existingWaypoint,
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: Functional component
}: ICreateWaypointDialogProps) => {
const { t } = useTranslation();

Expand Down Expand Up @@ -175,7 +176,7 @@ export const CreateWaypointDialog = ({

const flyToPosition = useMemo(
() => (pos: LngLat) => map?.flyTo(getFlyToConfig(pos)),
[getFlyToConfig, map],
[map],
);

const handlePositionUpdate = useMemo(
Expand All @@ -184,7 +185,7 @@ export const CreateWaypointDialog = ({
setWaypointPosition(e.lngLat);
flyToPosition(e.lngLat);
}, 300),
[map],
[flyToPosition],
);

const encodeEmoji = (emoji: string | null): number => {
Expand Down
4 changes: 1 addition & 3 deletions src/components/Map/MapView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export const MapView = () => {
}, 5000); // 5s

return () => clearInterval(timeout);
}, []);
}, [dispatch]);

const layers = useMemo(
() => [
Expand Down Expand Up @@ -193,8 +193,6 @@ export const MapView = () => {
[
nodesFeatureCollection,
edgesFeatureCollection,
setNodeHoverInfo,
setEdgeHoverInfo,
handleNodeClick,
activeNodeId,
],
Expand Down
1 change: 1 addition & 0 deletions src/components/Map/algorithms/Chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export const options = {
},
};

// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: Component needs to be rewritten
function convertToDataFormat() {
// data: Map<string, Map<string, Map<string, number>>>
const diffcen = {
Expand Down
1 change: 1 addition & 0 deletions src/components/config/ConfigInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export interface IConfigInputProps

export const ConfigInput = forwardRef<
HTMLInputElement,
// biome-ignore lint/suspicious/noExplicitAny: Need any to simplify complexity of being config-agnostic
IConfigInputProps & ReturnType<UseFormRegister<any>>
>(({ text, error, ...rest }, ref) => {
return (
Expand Down
1 change: 1 addition & 0 deletions src/components/config/ConfigSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export interface IConfigSelectProps

export const ConfigSelect = forwardRef<
HTMLSelectElement,
// biome-ignore lint/suspicious/noExplicitAny: Need any to simplify complexity of being config-agnostic
IConfigSelectProps & ReturnType<UseFormRegister<any>>
>(({ text, error, ...rest }, ref) => {
return (
Expand Down
13 changes: 7 additions & 6 deletions src/components/config/channel/ChannelConfigDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const ChannelConfigDetail = ({
currentConfig ?? undefined,
editedConfig ?? undefined,
),
[],
[currentConfig, editedConfig],
);

const updateStateFlags = (d: DeepPartial<ChannelConfigInput>) => {
Expand All @@ -80,7 +80,7 @@ export const ChannelConfigDetail = ({
useEffect(() => {
if (!defaultValues) return;
updateStateFlags(defaultValues);
}, [defaultValues]);
}, [updateStateFlags, defaultValues]);

const {
register,
Expand All @@ -106,14 +106,15 @@ export const ChannelConfigDetail = ({
500,
{ leading: true },
),
[],
[dispatch, updateStateFlags, channelNum],
);

watch(updateConfigHander);

// Cancel handlers when unmounting
useEffect(() => {
return () => updateConfigHander.cancel();
}, []);

watch(updateConfigHander);
}, [updateConfigHander]);

const handleFormReset = () => {
if (!currentMeshChannel) return;
Expand Down
13 changes: 7 additions & 6 deletions src/components/config/device/BluetoothConfigPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const BluetoothConfigPage = ({
device?.config.bluetooth ?? undefined,
editedConfig.bluetooth ?? undefined,
),
[],
[device, editedConfig],
);

const updateStateFlags = (d: DeepPartial<BluetoothConfigInput>) => {
Expand All @@ -71,7 +71,7 @@ export const BluetoothConfigPage = ({
useEffect(() => {
if (!defaultValues) return;
updateStateFlags(defaultValues);
}, [defaultValues]);
}, [updateStateFlags, defaultValues]);

const {
register,
Expand All @@ -93,14 +93,15 @@ export const BluetoothConfigPage = ({
500,
{ leading: true },
),
[],
[dispatch, updateStateFlags],
);

watch(updateConfigHander);

// Cancel handlers when unmounting
useEffect(() => {
return () => updateConfigHander.cancel();
}, []);

watch(updateConfigHander);
}, [updateConfigHander]);

const handleFormReset = () => {
if (!currentConfig?.bluetooth) return;
Expand Down
11 changes: 6 additions & 5 deletions src/components/config/device/DeviceConfigPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const DeviceConfigPage = ({
device?.config.device ?? undefined,
editedConfig.device ?? undefined,
),
[],
[device, editedConfig],
);

const {
Expand All @@ -72,14 +72,15 @@ export const DeviceConfigPage = ({
500,
{ leading: true },
),
[],
[dispatch],
);

watch(updateConfigHander);

// Cancel handlers when unmounting
useEffect(() => {
return () => updateConfigHander.cancel();
}, []);

watch(updateConfigHander);
}, [updateConfigHander]);

const handleFormReset = () => {
if (!currentConfig?.device) return;
Expand Down
11 changes: 6 additions & 5 deletions src/components/config/device/DisplayConfigPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const DisplayConfigPage = ({
device?.config.display ?? undefined,
editedConfig.display ?? undefined,
),
[],
[device, editedConfig],
);

const {
Expand All @@ -77,14 +77,15 @@ export const DisplayConfigPage = ({
500,
{ leading: true },
),
[],
[dispatch],
);

watch(updateConfigHander);

// Cancel handlers when unmounting
useEffect(() => {
return () => updateConfigHander.cancel();
}, []);

watch(updateConfigHander);
}, [updateConfigHander]);

const handleFormReset = () => {
if (!currentConfig?.display) return;
Expand Down
13 changes: 7 additions & 6 deletions src/components/config/device/LoRaConfigPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const LoRaConfigPage = ({ className = "" }: ILoRaConfigPageProps) => {
device?.config.lora ?? undefined,
editedConfig.lora ?? undefined,
),
[],
[device, editedConfig],
);

const updateStateFlags = (d: DeepPartial<LoRaConfigInput>) => {
Expand All @@ -73,7 +73,7 @@ export const LoRaConfigPage = ({ className = "" }: ILoRaConfigPageProps) => {
useEffect(() => {
if (!defaultValues) return;
updateStateFlags(defaultValues);
}, [defaultValues]);
}, [updateStateFlags, defaultValues]);

const {
register,
Expand All @@ -95,14 +95,15 @@ export const LoRaConfigPage = ({ className = "" }: ILoRaConfigPageProps) => {
500,
{ leading: true },
),
[],
[dispatch, updateStateFlags],
);

watch(updateConfigHander);

// Cancel handlers when unmounting
useEffect(() => {
return () => updateConfigHander.cancel();
}, []);

watch(updateConfigHander);
}, [updateConfigHander]);

const handleFormReset = () => {
if (!currentConfig?.lora) return;
Expand Down
13 changes: 7 additions & 6 deletions src/components/config/device/NetworkConfigPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const NetworkConfigPage = ({
device?.config.network ?? undefined,
editedConfig.network ?? undefined,
),
[],
[device, editedConfig],
);

const updateStateFlags = (d: DeepPartial<NetworkConfigInput>) => {
Expand All @@ -67,7 +67,7 @@ export const NetworkConfigPage = ({
useEffect(() => {
if (!defaultValues) return;
updateStateFlags(defaultValues);
}, [defaultValues]);
}, [updateStateFlags, defaultValues]);

const {
register,
Expand All @@ -89,14 +89,15 @@ export const NetworkConfigPage = ({
500,
{ leading: true },
),
[],
[dispatch, updateStateFlags],
);

watch(updateConfigHander);

// Cancel handlers when unmounting
useEffect(() => {
return () => updateConfigHander.cancel();
}, []);

watch(updateConfigHander);
}, [updateConfigHander]);

const handleFormReset = () => {
if (!currentConfig?.network) return;
Expand Down
13 changes: 7 additions & 6 deletions src/components/config/device/PositionConfigPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const PositionConfigPage = ({
device?.config.position ?? undefined,
editedConfig.position ?? undefined,
),
[],
[device, editedConfig],
);

const updateStateFlags = (d: DeepPartial<PositionConfigInput>) => {
Expand All @@ -81,7 +81,7 @@ export const PositionConfigPage = ({
useEffect(() => {
if (!defaultValues) return;
updateStateFlags(defaultValues);
}, [defaultValues]);
}, [updateStateFlags, defaultValues]);

const {
register,
Expand All @@ -103,14 +103,15 @@ export const PositionConfigPage = ({
500,
{ leading: true },
),
[],
[dispatch, updateStateFlags],
);

watch(updateConfigHander);

// Cancel handlers when unmounting
useEffect(() => {
return () => updateConfigHander.cancel();
}, []);

watch(updateConfigHander);
}, [updateConfigHander]);

const handleFormReset = () => {
if (!currentConfig?.position) return;
Expand Down
11 changes: 6 additions & 5 deletions src/components/config/device/PowerConfigPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const PowerConfigPage = ({ className = "" }: IPowerConfigPageProps) => {
device?.config.power ?? undefined,
editedConfig.power ?? undefined,
),
[],
[device, editedConfig],
);

const {
Expand All @@ -77,14 +77,15 @@ export const PowerConfigPage = ({ className = "" }: IPowerConfigPageProps) => {
500,
{ leading: true },
),
[],
[dispatch],
);

watch(updateConfigHander);

// Cancel handlers when unmounting
useEffect(() => {
return () => updateConfigHander.cancel();
}, []);

watch(updateConfigHander);
}, [updateConfigHander]);

const handleFormReset = () => {
if (!currentConfig?.power) return;
Expand Down
13 changes: 7 additions & 6 deletions src/components/config/module/AudioConfigPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const AudioConfigPage = ({ className = "" }: IAudioConfigPageProps) => {
undefined,
// editedConfig.audio ?? undefined
),
[],
[device],
);

const updateStateFlags = (d: DeepPartial<AudioModuleConfigInput>) => {
Expand All @@ -68,7 +68,7 @@ const AudioConfigPage = ({ className = "" }: IAudioConfigPageProps) => {
useEffect(() => {
if (!defaultValues) return;
updateStateFlags(defaultValues);
}, [defaultValues]);
}, [updateStateFlags, defaultValues]);

const {
register,
Expand All @@ -91,14 +91,15 @@ const AudioConfigPage = ({ className = "" }: IAudioConfigPageProps) => {
500,
{ leading: true },
),
[],
[updateStateFlags], // dispatch
);

watch(updateConfigHander);

// Cancel handlers when unmounting
useEffect(() => {
return () => updateConfigHander.cancel();
}, []);

watch(updateConfigHander);
}, [updateConfigHander]);

const handleFormReset = () => {
if (!currentConfig?.audio) return;
Expand Down
Loading

0 comments on commit fa26031

Please sign in to comment.