Skip to content

fix: resolve lint warnings/errors and apply formatting#1024

Open
danditomaso wants to merge 2 commits intomeshtastic:mainfrom
danditomaso:fix/lint-warnings-and-formatting
Open

fix: resolve lint warnings/errors and apply formatting#1024
danditomaso wants to merge 2 commits intomeshtastic:mainfrom
danditomaso:fix/lint-warnings-and-formatting

Conversation

@danditomaso
Copy link
Collaborator

Summary

  • Fix all 10 oxlint issues (2 errors, 8 warnings): unused catch params, stray expression, unnecessary hook deps, unused params, and unstable useMemo dependencies
  • Memoize tabs arrays in DeviceConfig, RadioConfig, and ModuleConfig to prevent unnecessary re-renders
  • Apply oxfmt formatting across all files

Test plan

  • pnpm run check passes with 0 warnings and 0 errors
  • Verify app renders correctly with no regressions

Fix 10 oxlint issues (2 errors, 8 warnings):
- Remove unused catch parameters in Security.tsx and ImportDialog.tsx
- Remove stray expression in Generator.tsx
- Add eslint-disable for debounced useCallback in FilterControl.tsx
- Remove unnecessary deps (resolveDB, store) in bindStoreToDevice.ts
- Prefix unused variant param in AppSidebar.tsx
- Memoize tabs arrays in DeviceConfig, RadioConfig, ModuleConfig
- Fix channels type in RadioConfig TabItem

Also applies oxfmt formatting across all files.
Copilot AI review requested due to automatic review settings March 10, 2026 01:59
@vercel
Copy link

vercel bot commented Mar 10, 2026

@danditomaso is attempting to deploy a commit to the Meshtastic Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Mar 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
web-test Ready Ready Preview, Comment Mar 10, 2026 2:01am

Request Review

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates the repo’s linting/formatting workflow to oxlint/oxfmt, resolves existing lint warnings/errors, and applies consistent formatting across the codebase. It also includes small React performance-oriented refactors (e.g., memoizing tab definitions) to reduce unnecessary re-renders.

Changes:

  • Replace Biome-based scripts with oxlint/oxfmt, add configs, and wire up husky + lint-staged.
  • Apply formatting/cleanup across many TS/TSX files and address oxlint findings (unused params, stray expressions, hook deps).
  • Memoize tab arrays in settings/config pages to avoid unnecessary re-renders.

Reviewed changes

Copilot reviewed 247 out of 248 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
.husky/pre-commit Adds pre-commit hook to run lint-staged (needs executable/shebang fix).
.vscode/settings.json Updates workspace editor settings (removes biome-specific save actions).
package.json Switches root scripts to oxlint/oxfmt, introduces husky + lint-staged.
packages/web/.oxfmtrc.json Adds oxfmt configuration.
packages/web/.oxlintrc.json Adds oxlint configuration/rules/plugins.
packages/web/package.json Adds oxlint/oxfmt scripts and dependencies for the web package.
packages/web/vite.config.ts Formatting-only change to header definition.
tests/utils/transportContract.ts Formatting-only change.
packages/core/src/utils/queue.ts Formatting-only change.
packages/core/src/utils/xmodem.ts Formatting-only change.
packages/core/src/utils/transform/toDevice.ts Formatting-only change.
packages/transport-deno/scripts/build_npm.ts Formatting-only change.
packages/transport-deno/src/transport.ts Formatting-only change.
packages/transport-http/src/transport.test.ts Formatting-only change.
packages/transport-http/src/transport.ts Formatting-only change.
packages/transport-node/src/transport.test.ts Formatting-only change.
packages/transport-node/src/transport.ts Formatting-only change.
packages/transport-node-serial/src/transport.ts Formatting-only change.
packages/transport-web-bluetooth/src/transport.test.ts Formatting-only change.
packages/transport-web-serial/src/transport.test.ts Formatting-only change.
packages/transport-web-serial/src/transport.ts Formatting-only change.
packages/ui/src/components/theme-provider.tsx Formatting-only change.
packages/ui/src/components/ui/badge.tsx Formatting-only change.
packages/ui/src/components/ui/button.tsx Formatting-only change.
packages/ui/src/components/ui/collapsible.tsx Formatting-only change.
packages/ui/src/components/ui/dropdown-menu.tsx Formatting-only change.
packages/ui/src/components/ui/sheet.tsx Formatting-only change.
packages/ui/src/components/ui/sidebar.tsx Formatting-only change.
packages/ui/src/components/ui/tooltip.tsx Formatting-only change.
packages/ui/src/hooks/use-mobile.ts Formatting-only change.
packages/ui/src/lib/components/Sidebar/AppSidebar.tsx Formatting-only change + unused prop renamed to _variant.
packages/ui/src/lib/components/theme-toggle.tsx Formatting-only change.
packages/web/src/App.tsx Comment formatting change.
packages/web/src/DeviceWrapper.tsx Formatting-only change.
packages/web/src/mocks/components/UI/Checkbox.tsx Formatting-only change.
packages/web/src/components/BatteryStatus.tsx Formatting-only change.
packages/web/src/components/CommandPalette/index.tsx Formatting-only change.
packages/web/src/components/DeviceInfoPanel.tsx Formatting-only change.
packages/web/src/components/Form/DynamicForm.tsx Formatting-only change.
packages/web/src/components/Form/DynamicFormField.tsx Formatting-only change.
packages/web/src/components/Form/FormInput.tsx Formatting-only change.
packages/web/src/components/Form/FormMultiSelect.tsx Formatting-only change.
packages/web/src/components/Form/FormSelect.tsx Formatting-only change.
packages/web/src/components/Form/FormToggle.tsx Formatting-only change.
packages/web/src/components/Form/FormWrapper.tsx Formatting-only change.
packages/web/src/components/Form/createZodResolver.ts Formatting-only change.
packages/web/src/components/LanguageSwitcher.tsx Formatting-only change.
packages/web/src/components/Map.tsx Formatting-only change.
packages/web/src/components/PageComponents/Channels/Channel.tsx Formatting-only change.
packages/web/src/components/PageComponents/Channels/Channels.tsx Formatting-only change.
packages/web/src/components/PageComponents/Connections/ConnectionStatusBadge.tsx Formatting-only change.
packages/web/src/components/PageComponents/Map/Layers/HeatmapLayer.tsx Formatting-only change.
packages/web/src/components/PageComponents/Map/Layers/NodesLayer.tsx Formatting-only change.
packages/web/src/components/PageComponents/Map/Layers/PrecisionLayer.tsx Formatting-only change.
packages/web/src/components/PageComponents/Map/Layers/SNRLayer.tsx Formatting-only change.
packages/web/src/components/PageComponents/Map/Layers/WaypointLayer.tsx Formatting-only change.
packages/web/src/components/PageComponents/Map/Markers/StackBadge.tsx Formatting-only change.
packages/web/src/components/PageComponents/Map/Popups/NodeDetail.tsx Formatting-only change.
packages/web/src/components/PageComponents/Map/Popups/WaypointDetail.tsx Formatting-only change.
packages/web/src/components/PageComponents/Map/Tools/MapLayerTool.tsx Formatting-only change.
packages/web/src/components/PageComponents/Messages/ChannelChat.tsx Formatting-only change.
packages/web/src/components/PageComponents/Messages/MessageActionsMenu.tsx Formatting-only change.
packages/web/src/components/PageComponents/Messages/MessageInput.test.tsx Formatting-only change.
packages/web/src/components/PageComponents/Messages/MessageInput.tsx Formatting-only change.
packages/web/src/components/PageComponents/Messages/MessageItem.tsx Formatting-only change.
packages/web/src/components/PageComponents/Messages/TraceRoute.test.tsx Formatting-only change.
packages/web/src/components/PageComponents/ModuleConfig/AmbientLighting.tsx Formatting-only change.
packages/web/src/components/PageComponents/ModuleConfig/Audio.tsx Formatting-only change.
packages/web/src/components/PageComponents/ModuleConfig/CannedMessage.tsx Formatting-only change.
packages/web/src/components/PageComponents/ModuleConfig/DetectionSensor.tsx Formatting-only change.
packages/web/src/components/PageComponents/ModuleConfig/ExternalNotification.tsx Formatting-only change.
packages/web/src/components/PageComponents/ModuleConfig/NeighborInfo.tsx Formatting-only change.
packages/web/src/components/PageComponents/ModuleConfig/Paxcounter.tsx Formatting-only change.
packages/web/src/components/PageComponents/ModuleConfig/RangeTest.tsx Formatting-only change.
packages/web/src/components/PageComponents/ModuleConfig/Serial.tsx Formatting-only change.
packages/web/src/components/PageComponents/ModuleConfig/StoreForward.tsx Formatting-only change.
packages/web/src/components/PageComponents/ModuleConfig/Telemetry.tsx Formatting-only change.
packages/web/src/components/PageComponents/Settings/Bluetooth.tsx Formatting-only change.
packages/web/src/components/PageComponents/Settings/Device/index.tsx Formatting-only change.
packages/web/src/components/PageComponents/Settings/Display.tsx Formatting-only change.
packages/web/src/components/PageComponents/Settings/LoRa.tsx Formatting-only change.
packages/web/src/components/PageComponents/Settings/Power.tsx Formatting-only change.
packages/web/src/components/PageComponents/Settings/User.tsx Formatting-only change.
packages/web/src/components/PageLayout.tsx Formatting-only change.
packages/web/src/components/Sidebar.tsx Formatting-only change.
packages/web/src/components/Toaster.tsx Formatting-only change.
packages/web/src/components/ThemeSwitcher.tsx Formatting-only change.
packages/web/src/components/UI/Accordion.tsx Formatting-only change.
packages/web/src/components/UI/AlertDialog.tsx Formatting-only change.
packages/web/src/components/UI/Badge.tsx Formatting-only change.
packages/web/src/components/UI/Blur.tsx Formatting-only change.
packages/web/src/components/UI/Button.tsx Formatting-only change.
packages/web/src/components/UI/Checkbox/Checkbox.test.tsx Formatting-only change.
packages/web/src/components/UI/Checkbox/index.tsx Formatting-only change.
packages/web/src/components/UI/Command.tsx Formatting-only change.
packages/web/src/components/UI/Dialog.tsx Formatting-only change.
packages/web/src/components/UI/DropdownMenu.tsx Formatting-only change.
packages/web/src/components/UI/ErrorPage.tsx Formatting-only change.
packages/web/src/components/UI/Footer.tsx Adds aria-label/title for anchor components + formatting.
packages/web/src/components/UI/Generator.tsx Removes stray expression + formatting.
packages/web/src/components/UI/Input.tsx Formatting-only change.
packages/web/src/components/UI/Menubar.tsx Formatting-only change (contains a displayname typo).
packages/web/src/components/UI/MultiSelect.tsx Formatting-only change.
packages/web/src/components/UI/ScrollArea.tsx Formatting-only change.
packages/web/src/components/UI/Select.tsx Formatting-only change.
packages/web/src/components/UI/Separator.tsx Formatting-only change.
packages/web/src/components/UI/Sidebar/SidebarButton.tsx Formatting-only change.
packages/web/src/components/UI/Sidebar/SidebarSection.tsx Formatting-only change.
packages/web/src/components/UI/Skeleton.tsx Formatting-only change.
packages/web/src/components/UI/Slider.tsx Formatting-only change.
packages/web/src/components/UI/Spinner.tsx Formatting-only change.
packages/web/src/components/UI/Tabs.tsx Formatting-only change.
packages/web/src/components/UI/Toast.tsx Formatting-only change.
packages/web/src/components/UI/ToggleGroup.tsx Formatting-only change.
packages/web/src/components/UI/Tooltip.tsx Formatting-only change.
packages/web/src/components/UI/Typography/Link.tsx Formatting-only change.
packages/web/src/components/UI/Typography/Subtle.tsx Formatting-only change.
packages/web/src/components/Dialog/AddConnectionDialog/validation.ts Formatting-only change.
packages/web/src/components/Dialog/ClearAllStoresDialog/ClearAllStoresDialog.test.tsx Formatting-only change.
packages/web/src/components/Dialog/ClearAllStoresDialog/ClearAllStoresDialog.tsx Formatting-only change.
packages/web/src/components/Dialog/ClientNotificationDialog/ClientNotificationDialog.tsx Formatting-only change.
packages/web/src/components/Dialog/DeleteMessagesDialog/DeleteMessagesDialog.test.tsx Formatting-only change.
packages/web/src/components/Dialog/DeleteMessagesDialog/DeleteMessagesDialog.tsx Formatting-only change.
packages/web/src/components/Dialog/FactoryResetConfigDialog/FactoryResetConfigDialog.test.tsx Formatting-only change.
packages/web/src/components/Dialog/FactoryResetConfigDialog/FactoryResetConfigDialog.tsx Formatting-only change.
packages/web/src/components/Dialog/FactoryResetDeviceDialog/FactoryResetDeviceDialog.test.tsx Formatting-only change.
packages/web/src/components/Dialog/FactoryResetDeviceDialog/FactoryResetDeviceDialog.tsx Formatting-only change.
packages/web/src/components/Dialog/LocationResponseDialog.tsx Formatting-only change (reveals incorrect coordinate scaling).
packages/web/src/components/Dialog/ManagedModeDialog.tsx Formatting-only change.
packages/web/src/components/Dialog/NewDeviceDialog.tsx Formatting-only change.
packages/web/src/components/Dialog/PKIBackupDialog.tsx Formatting-only change.
packages/web/src/components/Dialog/PkiRegenerateDialog.tsx Formatting-only change.
packages/web/src/components/Dialog/QRDialog.tsx Formatting-only change.
packages/web/src/components/Dialog/RebootDialog.test.tsx Formatting-only change.
packages/web/src/components/Dialog/RebootDialog.tsx Formatting-only change.
packages/web/src/components/Dialog/RefreshKeysDialog/RefreshKeysDialog.test.tsx Formatting-only change.
packages/web/src/components/Dialog/RefreshKeysDialog/RefreshKeysDialog.tsx Formatting-only change.
packages/web/src/components/Dialog/RemoveNodeDialog.tsx Formatting-only change.
packages/web/src/components/Dialog/ResetNodeDbDialog/ResetNodeDbDialog.test.tsx Formatting-only change.
packages/web/src/components/Dialog/ResetNodeDbDialog/ResetNodeDbDialog.tsx Formatting-only change.
packages/web/src/components/Dialog/TracerouteResponseDialog.tsx Formatting-only change.
packages/web/src/components/Dialog/UnsafeRolesDialog/UnsafeRolesDialog.tsx Formatting-only change.
packages/web/src/components/Dialog/UnsafeRolesDialog/useUnsafeRolesDialog.ts Formatting-only change.
packages/web/src/components/Dialog/useDialog.ts Formatting-only change.
packages/web/src/components/generic/Filter/FilterComponents.tsx Formatting-only change.
packages/web/src/components/generic/Filter/useFilterNode.test.ts Formatting-only change.
packages/web/src/components/generic/Mono.tsx Formatting-only change.
packages/web/src/components/generic/Table/index.test.tsx Formatting-only change.
packages/web/src/components/generic/Table/index.tsx Formatting-only change.
packages/web/src/core/dto/NodeNumToNodeInfoDTO.ts Formatting-only change.
packages/web/src/core/dto/PacketToMessageDTO.ts Formatting-only change.
packages/web/src/core/hooks/useBrowserFeatureDetection.ts Formatting-only change.
packages/web/src/core/hooks/useCopyToClipboard.ts Formatting-only change.
packages/web/src/core/hooks/useCookie.ts Formatting-only change.
packages/web/src/core/hooks/useDeviceContext.ts Formatting-only change.
packages/web/src/core/hooks/useFeatureFlags.ts Formatting-only change.
packages/web/src/core/hooks/useKeyBackupReminder.tsx Formatting-only change.
packages/web/src/core/hooks/useLRUList.ts Formatting-only change.
packages/web/src/core/hooks/useLang.ts Hook dependency cleanup to satisfy linting + formatting.
packages/web/src/core/hooks/useLocalStorage.ts Formatting-only change.
packages/web/src/core/hooks/useNewNodeNum.ts Formatting-only change.
packages/web/src/core/hooks/usePasswordVisibilityToggle.test.ts Formatting-only change.
packages/web/src/core/hooks/usePinnedItems.ts Formatting-only change.
packages/web/src/core/hooks/usePositionFlags.ts Formatting-only change.
packages/web/src/core/hooks/useTheme.ts Formatting-only change.
packages/web/src/core/hooks/useToast.ts Formatting-only change.
packages/web/src/core/hooks/useWaitForConfig.ts Formatting-only change.
packages/web/src/core/services/featureFlags.ts Formatting-only change.
packages/web/src/core/stores/appStore/index.ts Formatting-only change.
packages/web/src/core/stores/deviceStore/changeRegistry.ts Formatting-only change.
packages/web/src/core/stores/deviceStore/selectors.ts Formatting-only change.
packages/web/src/core/stores/deviceStore/types.ts Formatting-only change.
packages/web/src/core/stores/index.ts Formatting-only change.
packages/web/src/core/stores/messageStore/types.ts Formatting-only change.
packages/web/src/core/stores/nodeDBStore/nodeDBStore.test.tsx Formatting-only change.
packages/web/src/core/stores/nodeDBStore/nodeValidation.ts Formatting-only change.
packages/web/src/core/stores/nodeDBStore/types.ts Formatting-only change.
packages/web/src/core/stores/sidebarStore/index.tsx Formatting-only change.
packages/web/src/core/stores/utils/bindStoreToDevice.ts Hook deps adjustments + lint suppression comments.
packages/web/src/core/stores/utils/evictOldestEntries.ts Formatting-only change.
packages/web/src/core/stores/utils/indexDB.ts Formatting-only change.
packages/web/src/core/subscriptions.ts Formatting-only change.
packages/web/src/core/utils/bitwise.ts Formatting-only change.
packages/web/src/core/utils/color.test.ts Formatting-only change.
packages/web/src/core/utils/deepCompareConfig.ts Formatting-only change.
packages/web/src/core/utils/dotPath.test.ts Formatting-only change.
packages/web/src/core/utils/dotPath.ts Formatting-only change.
packages/web/src/core/utils/eventBus.ts Formatting-only change.
packages/web/src/core/utils/geo.ts Formatting-only change.
packages/web/src/core/utils/github.ts Formatting-only change.
packages/web/src/core/utils/ip.test.ts Formatting-only change.
packages/web/src/core/utils/ip.ts Formatting-only change.
packages/web/src/core/utils/signalColor.ts Formatting-only change.
packages/web/src/core/utils/string.ts Formatting-only change.
packages/web/src/pages/Connections/utils.ts Formatting-only change.
packages/web/src/pages/Settings/RadioConfig.tsx Memoizes tabs + adjusts config-change flagging for the Channels tab.
packages/web/src/pages/Settings/index.tsx Removes unused catch parameter + formatting.
packages/web/src/routes.tsx Formatting-only change.
packages/web/src/tests/setup.ts Formatting-only change.
packages/web/src/tests/test-utils.tsx Formatting-only change.
packages/web/src/validation/channel.test.ts Formatting-only change.
packages/web/src/validation/config/bluetooth.ts Formatting-only change.
packages/web/src/validation/config/device.ts Formatting-only change.
packages/web/src/validation/config/display.ts Formatting-only change.
packages/web/src/validation/config/lora.ts Formatting-only change.
packages/web/src/validation/config/network.ts Formatting-only change.
packages/web/src/validation/config/security.test.ts Formatting-only change.
packages/web/src/validation/config/security.ts Formatting-only change.
packages/web/src/validation/moduleConfig/ambientLighting.ts Formatting-only change.
packages/web/src/validation/moduleConfig/audio.ts Formatting-only change.
packages/web/src/validation/moduleConfig/cannedMessage.ts Formatting-only change.
packages/web/src/validation/moduleConfig/detectionSensor.ts Formatting-only change.
packages/web/src/validation/moduleConfig/externalNotification.ts Formatting-only change.
packages/web/src/validation/moduleConfig/neighborInfo.ts Formatting-only change.
packages/web/src/validation/moduleConfig/serial.ts Formatting-only change.
packages/web/src/validation/moduleConfig/storeForward.ts Formatting-only change.
packages/web/src/validation/pskSchema.ts Formatting-only change.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -0,0 +1 @@
pnpm lint-staged
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Husky hook file is missing a shebang (and the standard Husky wrapper), so Git may fail to execute it (ENOEXEC) and block commits on POSIX systems. Add the usual hook header and ensure the file is executable, e.g. start with a #!/usr/bin/env sh (or #!/bin/sh) line and source .husky/_/husky.sh before running pnpm lint-staged.

Copilot uses AI. Check for mistakes.
Comment on lines 63 to +70
href={`https://www.openstreetmap.org/?mlat=${
position.latitudeI ?? 0 / 1e7
}&mlon=${position.longitudeI ?? 0 / 1e7}&layers=N`}
target="_blank"
rel="noreferrer"
>
{" "}
{position.latitudeI ?? 0 / 1e7},{" "}
{position.longitudeI ?? 0 / 1e7}
{position.latitudeI ?? 0 / 1e7}, {position.longitudeI ?? 0 / 1e7}
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

position.latitudeI ?? 0 / 1e7 (and the longitude equivalent) has incorrect operator precedence; it evaluates to latitudeI (an int in 1e-7 degrees) when defined, instead of converting to degrees. Use (position.latitudeI ?? 0) / 1e7 (or compute lat/lon once after the hasCoordinates guard) so the displayed link and URL parameters are correct.

Copilot uses AI. Check for mistakes.
<span className={cn("ml-auto text-xs tracking-widest text-slate-500", className)} {...props} />
);
};
MenubarShortcut.displayname = "MenubarShortcut";
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

React uses the displayName property (capital N) for component names in devtools; displayname is a no-op. Rename this to MenubarShortcut.displayName for consistency with the rest of the file.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants