fix: remove unused imports and variables (part 1 — packages & non-web-core)#8751
fix: remove unused imports and variables (part 1 — packages & non-web-core)#8751darkingtail wants to merge 5 commits intomakeplane:previewfrom
Conversation
Resolve oxlint no-unused-vars warnings in packages/*, apps/admin, apps/space, apps/live, and apps/web (non-core).
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughWidespread non-functional cleanup: removed unused type/imports, renamed unused parameters with a leading underscore, removed unused local variables/destructuring, and replaced Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
apps/admin/app/root.tsx (1)
91-97:⚠️ Potential issue | 🟠 MajorIncorrect destructuring syntax for error parameter.
The property in
Route.ErrorBoundaryPropsis namederror(as confirmed byapps/web/app/root.tsxwhich uses{ error }), but this code destructures{ _error }, which attempts to extract a non-existent property and leaves_errorasundefined.🐛 Proposed fix
-export function ErrorBoundary({ _error }: Route.ErrorBoundaryProps) { +export function ErrorBoundary({ error: _error }: Route.ErrorBoundaryProps) { return ( <div> <p>Something went wrong.</p> </div> ); }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/admin/app/root.tsx` around lines 91 - 97, The ErrorBoundary function is destructuring the wrong prop name ({ _error }) from Route.ErrorBoundaryProps; change the parameter to destructure the actual property `{ error }` in the ErrorBoundary signature (function ErrorBoundary({ error }: Route.ErrorBoundaryProps)) and update any internal references to use `error` so the passed error object is available for rendering or logging.apps/web/ce/components/cycles/active-cycle/root.tsx (1)
46-54:⚠️ Potential issue | 🔴 CriticalAlias the prop instead of renaming the destructured key.
_activeCycleResolvedPathis not a property ofActiveCyclesComponentProps. The destructuring expects a property named_activeCycleResolvedPath, but the type definesactiveCycleResolvedPath. Callers still passactiveCycleResolvedPath={activeCycleResolvedPath}, so this will fail TypeScript type-checking. Use alias syntax to destructure the correct property:const ActiveCyclesComponent = observer(function ActiveCyclesComponent({ cycleId, activeCycle, - _activeCycleResolvedPath, + activeCycleResolvedPath: _activeCycleResolvedPath, workspaceSlug, projectId, handleFiltersUpdate, cycleIssueDetails, }: ActiveCyclesComponentProps) {🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/web/ce/components/cycles/active-cycle/root.tsx` around lines 46 - 54, The component destructures a non-existent prop name _activeCycleResolvedPath causing a type mismatch; update the parameter destructuring in ActiveCyclesComponent to pull the actual prop activeCycleResolvedPath and alias it if you need a different local name (e.g., activeCycleResolvedPath: _activeCycleResolvedPath) so callers passing activeCycleResolvedPath={...} type-check correctly; ensure the rest of the function uses the chosen local variable name consistently.
🧹 Nitpick comments (1)
packages/editor/src/core/components/menus/block-menu.tsx (1)
30-45: Finish removing the deadworkItemIdentifierprop.
BlockMenuno longer reads this prop, butPropsstill exposes it andpackages/editor/src/core/components/editors/rich-text/editor.tsxstill forwards it. Dropping it from the component contract would complete the cleanup and stop this no-op prop from propagating through the editor API.♻️ Suggested cleanup
type Props = { disabledExtensions?: IEditorProps["disabledExtensions"]; editor: Editor; flaggedExtensions?: IEditorProps["flaggedExtensions"]; - workItemIdentifier?: IEditorProps["workItemIdentifier"]; };🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/editor/src/core/components/menus/block-menu.tsx` around lines 30 - 45, Remove the dead workItemIdentifier prop from the BlockMenu contract and any upstream forwarding: delete workItemIdentifier from the Props type in BlockMenu (type Props) and update the BlockMenu function signature usage accordingly, then remove the corresponding prop forwarding in packages/editor/src/core/components/editors/rich-text/editor.tsx so it no longer passes workItemIdentifier to BlockMenu; ensure no other references to workItemIdentifier remain in this component or its props to complete the cleanup.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/space/app/root.tsx`:
- Around line 98-99: The ErrorBoundary component incorrectly destructures a
non-existent `_error` prop from Route.ErrorBoundaryProps; update the parameter
to use destructuring aliasing so the real `error` prop is renamed to `_error`
(e.g., change the param in the `ErrorBoundary` function signature to destructure
`error` as `_error`) or alternatively accept the whole props object as
`_props`/`_` if you intend to ignore it; adjust the `ErrorBoundary` function
signature (reference: ErrorBoundary, Route.ErrorBoundaryProps) accordingly.
In `@apps/web/ce/components/de-dupe/de-dupe-button.tsx`:
- Around line 17-18: Remove the unused default React import from this module:
the component DeDupeButtonRoot no longer references the React namespace (modern
JSX transform is used), so delete the React import statement and keep any
existing named imports if present to eliminate the unused import warning and
clean up the file.
In `@apps/web/ce/components/issues/issue-details/parent-select-root.tsx`:
- Around line 50-52: The catch blocks in parent-select-root.tsx currently
discard the caught exception by using _error; change the catch bindings to a
typed variable (e.g., error: unknown) and include that variable in your
logging/reporting before showing the generic UI toast. Specifically, replace
"catch (_error)" with "catch (error: unknown)" and update the console.error call
to include the error (and call any existing error-reporting helper like
reportError or processLogger.error with the error) so the stack/message is
preserved; apply the same change to the other catch block handling parent-link
failures.
---
Outside diff comments:
In `@apps/admin/app/root.tsx`:
- Around line 91-97: The ErrorBoundary function is destructuring the wrong prop
name ({ _error }) from Route.ErrorBoundaryProps; change the parameter to
destructure the actual property `{ error }` in the ErrorBoundary signature
(function ErrorBoundary({ error }: Route.ErrorBoundaryProps)) and update any
internal references to use `error` so the passed error object is available for
rendering or logging.
In `@apps/web/ce/components/cycles/active-cycle/root.tsx`:
- Around line 46-54: The component destructures a non-existent prop name
_activeCycleResolvedPath causing a type mismatch; update the parameter
destructuring in ActiveCyclesComponent to pull the actual prop
activeCycleResolvedPath and alias it if you need a different local name (e.g.,
activeCycleResolvedPath: _activeCycleResolvedPath) so callers passing
activeCycleResolvedPath={...} type-check correctly; ensure the rest of the
function uses the chosen local variable name consistently.
---
Nitpick comments:
In `@packages/editor/src/core/components/menus/block-menu.tsx`:
- Around line 30-45: Remove the dead workItemIdentifier prop from the BlockMenu
contract and any upstream forwarding: delete workItemIdentifier from the Props
type in BlockMenu (type Props) and update the BlockMenu function signature usage
accordingly, then remove the corresponding prop forwarding in
packages/editor/src/core/components/editors/rich-text/editor.tsx so it no longer
passes workItemIdentifier to BlockMenu; ensure no other references to
workItemIdentifier remain in this component or its props to complete the
cleanup.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 0324d839-2ffe-4bef-b8d5-bde4bd48fb4f
📒 Files selected for processing (80)
apps/admin/app/root.tsxapps/live/src/lib/pdf/styles.tsapps/space/app/root.tsxapps/space/hooks/use-editor-flagging.tsapps/web/app/(all)/[workspaceSlug]/(projects)/_sidebar.tsxapps/web/app/(all)/[workspaceSlug]/(projects)/profile/[userId]/header.tsxapps/web/app/(all)/[workspaceSlug]/(projects)/sidebar.tsxapps/web/app/(all)/invitations/page.tsxapps/web/ce/components/analytics/use-analytics-tabs.tsxapps/web/ce/components/automations/root.tsxapps/web/ce/components/command-palette/modals/work-item-level.tsxapps/web/ce/components/common/subscription/subscription-pill.tsxapps/web/ce/components/cycles/active-cycle/root.tsxapps/web/ce/components/cycles/additional-actions.tsxapps/web/ce/components/cycles/analytics-sidebar/root.tsxapps/web/ce/components/de-dupe/de-dupe-button.tsxapps/web/ce/components/de-dupe/duplicate-modal/root.tsxapps/web/ce/components/de-dupe/duplicate-popover/root.tsxapps/web/ce/components/de-dupe/issue-block/button-label.tsxapps/web/ce/components/epics/epic-modal/modal.tsxapps/web/ce/components/estimates/inputs/time-input.tsxapps/web/ce/components/estimates/points/delete.tsxapps/web/ce/components/estimates/update/modal.tsxapps/web/ce/components/gantt-chart/blocks/blocks-list.tsxapps/web/ce/components/gantt-chart/dependency/blockDraggables/left-draggable.tsxapps/web/ce/components/gantt-chart/dependency/blockDraggables/right-draggable.tsxapps/web/ce/components/gantt-chart/dependency/dependency-paths.tsxapps/web/ce/components/inbox/source-pill.tsxapps/web/ce/components/issues/filters/issue-types.tsxapps/web/ce/components/issues/filters/team-project.tsxapps/web/ce/components/issues/issue-detail-widgets/action-buttons.tsxapps/web/ce/components/issues/issue-detail-widgets/collapsibles.tsxapps/web/ce/components/issues/issue-detail-widgets/modals.tsxapps/web/ce/components/issues/issue-details/additional-activity-root.tsxapps/web/ce/components/issues/issue-details/additional-properties.tsxapps/web/ce/components/issues/issue-details/issue-creator.tsxapps/web/ce/components/issues/issue-details/issue-properties-activity/root.tsxapps/web/ce/components/issues/issue-details/issue-type-activity.tsxapps/web/ce/components/issues/issue-details/parent-select-root.tsxapps/web/ce/components/issues/issue-layouts/additional-properties.tsxapps/web/ce/components/issues/issue-layouts/issue-stats.tsxapps/web/ce/components/issues/issue-layouts/quick-action-dropdowns/duplicate-modal.tsxapps/web/ce/components/issues/issue-modal/modal-additional-properties.tsxapps/web/ce/components/issues/worklog/activity/filter-root.tsxapps/web/ce/components/issues/worklog/activity/root.tsxapps/web/ce/components/issues/worklog/activity/worklog-create-button.tsxapps/web/ce/components/issues/worklog/property/root.tsxapps/web/ce/components/onboarding/tour/root.tsxapps/web/ce/components/pages/modals/modals.tsxapps/web/ce/components/sidebar/project-navigation-root.tsxapps/web/ce/components/views/helper.tsxapps/web/ce/components/workspace-notifications/notification-card/root.tsxapps/web/ce/components/workspace/sidebar/sidebar-item.tsxapps/web/ce/components/workspace/upgrade-badge.tsxapps/web/ce/hooks/use-debounced-duplicate-issues.tsxapps/web/ce/hooks/use-issue-properties.tsxapps/web/ce/store/issue/helpers/base-issue-store.tsapps/web/ce/store/issue/helpers/base-issue.store.tsapps/web/ce/store/timeline/base-timeline.store.tspackages/editor/src/core/components/editors/editor-container.tsxpackages/editor/src/core/components/editors/link-view-container.tsxpackages/editor/src/core/components/menus/block-menu.tsxpackages/editor/src/core/components/menus/bubble-menu/color-selector.tsxpackages/editor/src/core/components/menus/bubble-menu/link-selector.tsxpackages/editor/src/core/components/menus/bubble-menu/node-selector.tsxpackages/editor/src/core/components/menus/bubble-menu/root.tsxpackages/editor/src/core/extensions/custom-image/components/block.tsxpackages/editor/src/core/hooks/use-collaborative-editor.tspackages/editor/src/core/props.tspackages/editor/src/core/types/config.tspackages/propel/src/tab-navigation/tab-navigation-list.tsxpackages/ui/src/collapsible/collapsible-button.tsxpackages/ui/src/dropdown/common/options.tsxpackages/ui/src/dropdown/multi-select.tsxpackages/ui/src/dropdown/single-select.tsxpackages/ui/src/link/block.tsxpackages/ui/src/progress/radial-progress.tsxpackages/ui/src/scroll-area.tsxpackages/ui/src/tabs/tabs.tsxpackages/utils/src/url.ts
💤 Files with no reviewable changes (52)
- apps/web/ce/components/command-palette/modals/work-item-level.tsx
- packages/editor/src/core/components/menus/bubble-menu/link-selector.tsx
- packages/ui/src/scroll-area.tsx
- apps/web/ce/components/cycles/analytics-sidebar/root.tsx
- apps/web/ce/components/estimates/points/delete.tsx
- apps/web/ce/components/issues/issue-details/issue-creator.tsx
- apps/web/ce/components/workspace/sidebar/sidebar-item.tsx
- packages/ui/src/link/block.tsx
- apps/web/app/(all)/[workspaceSlug]/(projects)/_sidebar.tsx
- packages/ui/src/collapsible/collapsible-button.tsx
- apps/web/ce/components/issues/issue-detail-widgets/modals.tsx
- apps/web/ce/components/issues/filters/team-project.tsx
- packages/ui/src/dropdown/multi-select.tsx
- packages/propel/src/tab-navigation/tab-navigation-list.tsx
- packages/ui/src/progress/radial-progress.tsx
- packages/editor/src/core/components/menus/bubble-menu/node-selector.tsx
- apps/web/ce/components/issues/issue-details/issue-type-activity.tsx
- apps/web/app/(all)/[workspaceSlug]/(projects)/sidebar.tsx
- apps/web/ce/components/onboarding/tour/root.tsx
- apps/web/ce/components/sidebar/project-navigation-root.tsx
- apps/web/ce/components/issues/worklog/activity/worklog-create-button.tsx
- packages/editor/src/core/components/menus/bubble-menu/root.tsx
- packages/editor/src/core/hooks/use-collaborative-editor.ts
- apps/web/ce/components/issues/issue-details/additional-activity-root.tsx
- apps/web/app/(all)/[workspaceSlug]/(projects)/profile/[userId]/header.tsx
- apps/web/ce/components/issues/issue-details/issue-properties-activity/root.tsx
- apps/web/ce/components/gantt-chart/blocks/blocks-list.tsx
- packages/ui/src/tabs/tabs.tsx
- packages/editor/src/core/components/menus/bubble-menu/color-selector.tsx
- packages/editor/src/core/components/editors/link-view-container.tsx
- apps/web/ce/components/issues/worklog/activity/root.tsx
- apps/web/ce/components/issues/worklog/activity/filter-root.tsx
- apps/live/src/lib/pdf/styles.ts
- apps/web/ce/components/workspace/upgrade-badge.tsx
- packages/ui/src/dropdown/single-select.tsx
- packages/editor/src/core/props.ts
- packages/editor/src/core/types/config.ts
- apps/web/ce/components/issues/worklog/property/root.tsx
- apps/web/ce/components/cycles/additional-actions.tsx
- apps/web/app/(all)/invitations/page.tsx
- apps/web/ce/components/issues/filters/issue-types.tsx
- apps/web/ce/components/de-dupe/duplicate-popover/root.tsx
- apps/web/ce/components/workspace-notifications/notification-card/root.tsx
- apps/web/ce/components/automations/root.tsx
- apps/web/ce/components/issues/issue-modal/modal-additional-properties.tsx
- apps/web/ce/components/issues/issue-details/additional-properties.tsx
- apps/web/ce/components/estimates/inputs/time-input.tsx
- packages/ui/src/dropdown/common/options.tsx
- apps/web/ce/components/estimates/update/modal.tsx
- apps/web/ce/components/issues/issue-detail-widgets/action-buttons.tsx
- apps/web/ce/components/issues/issue-layouts/quick-action-dropdowns/duplicate-modal.tsx
- apps/web/ce/components/issues/issue-detail-widgets/collapsibles.tsx
| export function DeDupeButtonRoot(_props: TDeDupeButtonRoot) { | ||
| return <></>; |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
FILE='apps/web/ce/components/de-dupe/de-dupe-button.tsx'
echo "Relevant snippet:"
sed -n '7,19p' "$FILE"
echo
echo "React namespace usages in this file (expected: no matches):"
rg -n '\bReact\.' "$FILE" || trueRepository: makeplane/plane
Length of output: 400
Remove the unused React default import.
The component no longer uses the React namespace, and this file uses the modern JSX transform. The unused import on line 7 should be removed.
♻️ Proposed fix
-import React from "react";
// local components🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@apps/web/ce/components/de-dupe/de-dupe-button.tsx` around lines 17 - 18,
Remove the unused default React import from this module: the component
DeDupeButtonRoot no longer references the React namespace (modern JSX transform
is used), so delete the React import statement and keep any existing named
imports if present to eliminate the unused import warning and clean up the file.
| } catch (_error) { | ||
| console.error("something went wrong while fetching the issue"); | ||
| } |
There was a problem hiding this comment.
Keep the caught error available for logging/reporting.
These renames make both failure paths intentionally discard the exception object, so parent-link failures now only surface a generic message/toast with no stack or error details. Keep the binding typed as unknown and include it in the log/report before showing generic UI feedback.
🛠️ Suggested cleanup
- } catch (_error) {
- console.error("something went wrong while fetching the issue");
+ } catch (error: unknown) {
+ console.error("something went wrong while updating the parent issue", error);
}
@@
- } catch (_error) {
+ } catch (error: unknown) {
+ console.error("something went wrong while removing the sub-issue", error);
setToast({
type: TOAST_TYPE.ERROR,
title: t("common.error.label"),
message: t("common.something_went_wrong"),
});
}As per coding guidelines, "Use try-catch with proper error types and log errors appropriately for error handling".
Also applies to: 66-72
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@apps/web/ce/components/issues/issue-details/parent-select-root.tsx` around
lines 50 - 52, The catch blocks in parent-select-root.tsx currently discard the
caught exception by using _error; change the catch bindings to a typed variable
(e.g., error: unknown) and include that variable in your logging/reporting
before showing the generic UI toast. Specifically, replace "catch (_error)" with
"catch (error: unknown)" and update the console.error call to include the error
(and call any existing error-reporting helper like reportError or
processLogger.error with the error) so the stack/message is preserved; apply the
same change to the other catch block handling parent-link failures.
- Use destructuring alias for activeCycleResolvedPath - Format propel tab-navigation file
Reorder Tailwind classes to match oxfmt canonical ordering.
Summary
Remove unused imports and variables flagged by
oxlintno-unused-varsrule.Scope:
packages/*,apps/admin,apps/space,apps/live, andapps/web(non-core)Files: 80
Changes:
_Context
This is 2 of 4 PRs splitting the full lint cleanup into reviewable chunks.
Test plan
pnpm turbo run build --filter='./packages/*'passesSummary by CodeRabbit