fix: #1803 cleanups for noUnusedLocals and noUnusedParameters#1804
fix: #1803 cleanups for noUnusedLocals and noUnusedParameters#1804shinokada merged 2 commits intothemesberg:mainfrom
Conversation
|
@shinokada is attempting to deploy a commit to the Themesberg Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughMass edits removing unused parameters, local variables, and imports across components and example pages; several handler signatures were made parameterless and a PhoneInputProps generic was removed. No broad new features added. Changes
Sequence Diagram(s)sequenceDiagram
participant Component as Component (Alert/Badge/Toast/Dialog)
participant Dispatcher as event dispatcher
participant State as local visible state
Note over Component,Dispatcher: old/new flow identical except removed handler param
Component->>Dispatcher: dispatch("close") : no event parameter required
alt dispatch not cancelled
Dispatcher-->>State: (handler) set visible = false
else dispatch cancelled
Dispatcher-->>Component: keep visible = true
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ 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: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (4)
src/routes/builder/drawer/+page.svelte (2)
68-70: Remove commented-out code.This commented-out code block should be removed entirely as part of the cleanup for unused locals.
Apply this diff to remove the commented code:
- // $effect(() => { - // changeOutsideclickStatus; - // }) -
81-91: Critical: Code generator doesn't match the interactive component behavior.The code generation logic always uses
currentTransition.paramsto build the params string, but the actual interactive component on line 129 uses conditional logic:currentPlacement.placement === "left" ? currentTransition.params : currentPlacement.params.This means the generated code will not match what users see in the interactive preview when they select non-left placements.
Apply this diff to align the code generator with the actual component behavior:
if (currentTransition !== transitions[0]) { props.push(` transitionType={${currentTransition.transition.name}}`); + // Use placement params for non-left placements, transition params for left + const paramValues = currentPlacement.placement === "left" ? currentTransition.params : currentPlacement.params; const paramsString = Object.entries(currentTransition.params) .map(([key, value]) => { if (key === "easing") { // For easing, use the name of the easing function return `${key}:${value.name || "linear"}`; } // For other values, just use the literal value return `${key}:${value}`; }) .join(","); props.push(` params={{${paramsString}}}`); }Wait, I need to fix this - the
paramsStringshould useparamValues:if (currentTransition !== transitions[0]) { props.push(` transitionType={${currentTransition.transition.name}}`); + // Use placement params for non-left placements, transition params for left + const paramValues = currentPlacement.placement === "left" ? currentTransition.params : currentPlacement.params; - const paramsString = Object.entries(currentTransition.params) + const paramsString = Object.entries(paramValues) .map(([key, value]) => { if (key === "easing") { // For easing, use the name of the easing function return `${key}:${value.name || "linear"}`; } // For other values, just use the literal value return `${key}:${value}`; }) .join(","); props.push(` params={{${paramsString}}}`); }src/routes/builder/device-mockup/+page.svelte (1)
106-106: Pre-existing typo: missing closing bracket in Tailwind class.The class string has
w-[188pxinstead ofw-[188px], causing the width utility to be ignored during rendering.Apply this diff to fix the typo:
- class: "dark:hidden h-[193px] w-[188px", + class: "dark:hidden h-[193px] w-[188px]",src/lib/navbar/NavHamburger.svelte (1)
8-8: Remove the unusedMouseEventHandlerimport.The
MouseEventHandlertype is no longer used after simplifying thetogglefunction signature to be parameterless.Apply this diff to remove the unused import:
- import type { NavbarState, NavHamburgerProps, NavbarBreakpoint } from "$lib/types"; - import type { MouseEventHandler } from "svelte/elements"; + import type { NavbarState, NavHamburgerProps, NavbarBreakpoint } from "$lib/types";
🧹 Nitpick comments (4)
src/routes/builder/layout/+page.svelte (1)
4-4: Consider removing commented-out imports.The commented-out imports at lines 4 and 17 appear to be stale code. If they're no longer needed, removing them would further clean up the codebase.
Also applies to: 17-17
src/lib/forms/tags/Tags.svelte (1)
54-56: Dead code:checkDropdownPositionis a no-op stub.This function only checks if
inputContainerexists but performs no actual work. It's being called fromhandleInput(line 106) and window scroll/resize events (line 138), but does nothing useful. The actual dropdown positioning logic resides inupdateDropdownPositionand is managed by the$effectblock.Consider removing this stub function and its associated event handlers if dropdown positioning via
autoUpdatein the$effectblock is sufficient.Apply this diff to remove the dead code:
- const checkDropdownPosition = () => { - if (!inputContainer) return; - };And remove the event handlers:
-<svelte:window on:scroll={checkDropdownPosition} on:resize={checkDropdownPosition} /> +<svelte:window />src/routes/docs/plugins/examples/datatable/Callback.svelte (1)
29-31: Approve parameter removal, but consider improving the type.The removal of the unused
dataTableparameter is correct. However, theany[]type formatchedreduces type safety.Consider specifying a more concrete type based on the data structure from
sample.json:- function handleSearch(query: string, matched: any[]): void { + function handleSearch(query: string, matched: typeof items): void {As per static analysis hints.
src/lib/tooltip/Tooltip.svelte (1)
6-6: Consider removing commented code rather than leaving it in.The
getThemeimport and usage are commented out rather than removed. If this code is truly unused, it should be deleted. If it might be needed in the future, consider documenting why it's commented or tracking it in an issue.Apply this diff to remove the commented lines:
- // import { getTheme } from "$lib/theme/themeUtils"; - let { type = "dark", color = undefined, trigger = "hover", arrow = true, children, placement = "top", onbeforetoggle: _onbeforetoggle, class: className, isOpen = $bindable(false), ...restProps }: TooltipProps = $props(); - - // const theme = getTheme("tooltip");Also applies to: 10-10
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (107)
src/lib/alert/Alert.svelte(1 hunks)src/lib/badge/Badge.svelte(1 hunks)src/lib/carousel/Carousel.svelte(2 hunks)src/lib/dialog/Dialog.svelte(5 hunks)src/lib/forms/input-field/Input.svelte(3 hunks)src/lib/forms/tags/Tags.svelte(1 hunks)src/lib/forms/timepicker/Timepicker.svelte(0 hunks)src/lib/mega-menu/MegaMenu.svelte(1 hunks)src/lib/navbar/NavHamburger.svelte(1 hunks)src/lib/rating/Review.svelte(1 hunks)src/lib/step-indicator/StepIndicator.svelte(1 hunks)src/lib/stepper/DetailedStepper.svelte(1 hunks)src/lib/stepper/VerticalStepper.svelte(1 hunks)src/lib/toast/Toast.svelte(1 hunks)src/lib/tooltip/Tooltip.svelte(1 hunks)src/lib/types.ts(1 hunks)src/routes/admin-dashboard/(no-sidebar)/playground/stacked/Playground.svelte(1 hunks)src/routes/admin-dashboard/(sidebar)/+layout.svelte(1 hunks)src/routes/admin-dashboard/(sidebar)/Frame.svelte(1 hunks)src/routes/admin-dashboard/(sidebar)/Navbar.svelte(1 hunks)src/routes/admin-dashboard/(sidebar)/Sidebar.svelte(2 hunks)src/routes/admin-dashboard/(sidebar)/components/productdrawer/+page.svelte(0 hunks)src/routes/admin-dashboard/(sidebar)/layouts/sidebar/+page.svelte(0 hunks)src/routes/admin-dashboard/(sidebar)/quickstart/+page.svelte(1 hunks)src/routes/blocks/+page.svelte(0 hunks)src/routes/blocks/utils/CompoAttributesViewer.svelte(0 hunks)src/routes/blocks/utils/Footer.svelte(1 hunks)src/routes/blocks/utils/MetaTag.svelte(0 hunks)src/routes/blocks/utils/PageHeadSection.svelte(1 hunks)src/routes/blocks/utils/SectionHeader.svelte(1 hunks)src/routes/blocks/utils/Sectioncompo.svelte(1 hunks)src/routes/blocks/utils/fetchPost.ts(0 hunks)src/routes/builder/banner/+page.svelte(1 hunks)src/routes/builder/blockquote/+page.svelte(0 hunks)src/routes/builder/button/+page.svelte(0 hunks)src/routes/builder/card/+page.svelte(0 hunks)src/routes/builder/device-mockup/+page.svelte(1 hunks)src/routes/builder/drawer/+page.svelte(1 hunks)src/routes/builder/dropdown/+page.svelte(0 hunks)src/routes/builder/heading/+page.svelte(1 hunks)src/routes/builder/image/+page.svelte(0 hunks)src/routes/builder/layout/+page.svelte(1 hunks)src/routes/builder/link/+page.svelte(0 hunks)src/routes/builder/modal/+page.svelte(0 hunks)src/routes/builder/popover/+page.svelte(0 hunks)src/routes/builder/radio/+page.svelte(1 hunks)src/routes/builder/range/+page.svelte(1 hunks)src/routes/builder/select/+page.svelte(1 hunks)src/routes/builder/skeleton/+page.svelte(1 hunks)src/routes/builder/textarea/+page.svelte(3 hunks)src/routes/builder/toggle/+page.svelte(1 hunks)src/routes/builder/utils/DynamicCodeBlockHighlight.svelte(1 hunks)src/routes/docs-examples/components/banner/Onclose.svelte(1 hunks)src/routes/docs-examples/components/buttons/Colored.svelte(1 hunks)src/routes/docs-examples/components/card/Horizontal.svelte(1 hunks)src/routes/docs-examples/components/carousel/Caption.svelte(0 hunks)src/routes/docs-examples/components/clipboard/ApiKeys.svelte(0 hunks)src/routes/docs-examples/components/clipboard/CopyButton.svelte(1 hunks)src/routes/docs-examples/components/clipboard/Source.svelte(0 hunks)src/routes/docs-examples/components/datepicker/ActionSlot.svelte(1 hunks)src/routes/docs-examples/components/datepicker/Local.svelte(1 hunks)src/routes/docs-examples/components/drawer/Bottom.svelte(1 hunks)src/routes/docs-examples/components/drawer/Contact.svelte(1 hunks)src/routes/docs-examples/components/drawer/Default.svelte(0 hunks)src/routes/docs-examples/components/drawer/Disabled.svelte(1 hunks)src/routes/docs-examples/components/drawer/Enabled.svelte(1 hunks)src/routes/docs-examples/components/drawer/Left.svelte(1 hunks)src/routes/docs-examples/components/drawer/NonModal.svelte(1 hunks)src/routes/docs-examples/components/drawer/OnlyOutside.svelte(1 hunks)src/routes/docs-examples/components/drawer/Position.svelte(1 hunks)src/routes/docs-examples/components/drawer/Right.svelte(1 hunks)src/routes/docs-examples/components/drawer/Scrolling.svelte(1 hunks)src/routes/docs-examples/components/drawer/Top.svelte(1 hunks)src/routes/docs-examples/components/indicators/Status.svelte(1 hunks)src/routes/docs-examples/components/mega-menu/Default.svelte(1 hunks)src/routes/docs-examples/components/mega-menu/Transition.svelte(1 hunks)src/routes/docs-examples/components/modal/Crypto.svelte(1 hunks)src/routes/docs-examples/components/modal/Events.svelte(1 hunks)src/routes/docs-examples/components/modal/Popup.svelte(1 hunks)src/routes/docs-examples/components/navbar/Search.svelte(1 hunks)src/routes/docs-examples/components/rating/Count.svelte(1 hunks)src/routes/docs-examples/components/sidebar/AlwaysOpen.svelte(1 hunks)src/routes/docs-examples/components/sidebar/OnClickHandler.svelte(1 hunks)src/routes/docs-examples/components/table/Data.svelte(1 hunks)src/routes/docs-examples/components/table/Search.svelte(1 hunks)src/routes/docs-examples/components/toast/Transitions.svelte(1 hunks)src/routes/docs-examples/components/tooltip/Placement.svelte(0 hunks)src/routes/docs-examples/extend/button-toggle/ButtonColor.svelte(0 hunks)src/routes/docs-examples/extend/virtual-list/InteractiveItems.svelte(1 hunks)src/routes/docs-examples/extend/virtual-list/LargeDataset.svelte(1 hunks)src/routes/docs-examples/extend/virtual-list/VariableHeights.svelte(1 hunks)src/routes/docs-examples/forms/input-field/EventHandlers.svelte(1 hunks)src/routes/docs-examples/forms/input-field/Icon.svelte(1 hunks)src/routes/docs-examples/forms/number-input/Counter.svelte(1 hunks)src/routes/docs-examples/forms/phone-input/Select.svelte(1 hunks)src/routes/docs-examples/forms/select/Dropdown.svelte(1 hunks)src/routes/docs-examples/forms/textarea/Chatroom.svelte(1 hunks)src/routes/docs-examples/forms/textarea/Comment.svelte(1 hunks)src/routes/docs-examples/forms/timepicker/Drawer.svelte(1 hunks)src/routes/docs-examples/forms/timepicker/StateAndBind.svelte(0 hunks)src/routes/docs-examples/forms/toggle/Disabled.svelte(1 hunks)src/routes/docs-examples/typography/list/Description.svelte(1 hunks)src/routes/docs-examples/utilities/toolbar/Colored.svelte(1 hunks)src/routes/docs-examples/utilities/toolbar/CommentBox.svelte(1 hunks)src/routes/docs-examples/utilities/toolbar/Default.svelte(1 hunks)src/routes/docs/+layout.svelte(0 hunks)src/routes/docs/plugins/examples/datatable/Callback.svelte(1 hunks)
⛔ Files not processed due to max files limit (15)
- src/routes/docs/plugins/examples/datatable/CustomCellRenderer.svelte
- src/routes/docs/plugins/examples/datatable/Export.svelte
- src/routes/docs/plugins/examples/datatable/FilteringData.svelte
- src/routes/docs/plugins/examples/wysiwyg/Fonts.svelte
- src/routes/docs/plugins/examples/wysiwyg/Invisible.svelte
- src/routes/docs/plugins/examples/wysiwyg/Layouts.svelte
- src/routes/docs/plugins/examples/wysiwyg/Lists.svelte
- src/routes/illustrations/utils/helper.ts
- src/routes/landing/Featured.svelte
- src/routes/layouts/ComponentsLayout.svelte
- src/routes/utils/CarbonAds.svelte
- src/routes/utils/CompoAttributesViewer.svelte
- src/routes/utils/CopyCliboardInput.svelte
- src/routes/utils/ExampleWrapper.svelte
- tsconfig.json
💤 Files with no reviewable changes (23)
- src/routes/builder/card/+page.svelte
- src/routes/blocks/utils/fetchPost.ts
- src/routes/admin-dashboard/(sidebar)/components/productdrawer/+page.svelte
- src/routes/builder/popover/+page.svelte
- src/routes/builder/link/+page.svelte
- src/routes/docs-examples/components/tooltip/Placement.svelte
- src/routes/docs-examples/components/clipboard/Source.svelte
- src/lib/forms/timepicker/Timepicker.svelte
- src/routes/docs/+layout.svelte
- src/routes/docs-examples/extend/button-toggle/ButtonColor.svelte
- src/routes/builder/image/+page.svelte
- src/routes/builder/blockquote/+page.svelte
- src/routes/docs-examples/components/drawer/Default.svelte
- src/routes/builder/dropdown/+page.svelte
- src/routes/docs-examples/forms/timepicker/StateAndBind.svelte
- src/routes/docs-examples/components/carousel/Caption.svelte
- src/routes/builder/button/+page.svelte
- src/routes/docs-examples/components/clipboard/ApiKeys.svelte
- src/routes/admin-dashboard/(sidebar)/layouts/sidebar/+page.svelte
- src/routes/blocks/utils/CompoAttributesViewer.svelte
- src/routes/blocks/+page.svelte
- src/routes/builder/modal/+page.svelte
- src/routes/blocks/utils/MetaTag.svelte
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-08-31T14:31:57.582Z
Learnt from: jjagielka
PR: themesberg/flowbite-svelte#1745
File: src/lib/forms/checkbox/CheckboxButton.svelte:16-17
Timestamp: 2025-08-31T14:31:57.582Z
Learning: In Svelte 5, the `on:event` syntax for event forwarding is obsolete. Event handlers are passed as callback props (e.g., `onchange`, `oninput`) through `{...restProps}` instead of using `on:change`, `on:input` etc.
Applied to files:
src/routes/docs-examples/forms/input-field/EventHandlers.svelte
📚 Learning: 2025-09-04T10:33:41.720Z
Learnt from: jjagielka
PR: themesberg/flowbite-svelte#1751
File: src/lib/tabs/TabItem.svelte:33-33
Timestamp: 2025-09-04T10:33:41.720Z
Learning: In Svelte 5, DOM event handlers should use function props like `onclick`, `onchange`, `oninput` etc. The `on:click`, `on:change` syntax from previous Svelte versions is deprecated/obsolete in Svelte 5.
Applied to files:
src/routes/docs-examples/forms/input-field/EventHandlers.svelte
📚 Learning: 2024-10-15T22:41:47.429Z
Learnt from: Chizaruu
PR: themesberg/flowbite-svelte#1464
File: src/routes/component-data/Datepicker.json:0-0
Timestamp: 2024-10-15T22:41:47.429Z
Learning: The component should be named 'Datepicker' (with lowercase 'p') throughout the codebase to maintain consistency.
Applied to files:
src/routes/docs-examples/components/datepicker/Local.svelte
🧬 Code graph analysis (1)
src/lib/types.ts (1)
src/lib/forms/phoneinput/theme.ts (1)
PhoneInputVariants(4-4)
🪛 ESLint
src/routes/docs/plugins/examples/datatable/Callback.svelte
[error] 29-29: Unexpected any. Specify a different type.
(@typescript-eslint/no-explicit-any)
src/routes/admin-dashboard/(no-sidebar)/playground/stacked/Playground.svelte
[error] 26-28: Each block should have a key
(svelte/require-each-key)
src/lib/stepper/DetailedStepper.svelte
[error] 21-37: Each block should have a key
(svelte/require-each-key)
src/lib/step-indicator/StepIndicator.svelte
[error] 36-49: Each block should have a key
(svelte/require-each-key)
src/routes/docs-examples/components/mega-menu/Transition.svelte
[error] 33-33: Unexpected href link without resolve().
(svelte/no-navigation-without-resolve)
[error] 41-41: Unexpected href link without resolve().
(svelte/no-navigation-without-resolve)
src/lib/stepper/VerticalStepper.svelte
[error] 21-47: Each block should have a key
(svelte/require-each-key)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Playwright and Lint
🔇 Additional comments (86)
src/routes/docs-examples/components/indicators/Status.svelte (1)
2-2: LGTM!The removal of the unused
Indicatorimport is correct. The file only uses theAvatarcomponent with itsdotprop to display status indicators, soIndicatorwas indeed unnecessary.src/routes/docs-examples/components/datepicker/ActionSlot.svelte (1)
9-9: LGTM! Unused parameter correctly removed.The
closeparameter was not referenced in the snippet body, so removing it appropriately satisfies the TypeScriptnoUnusedParameterscompiler option without affecting functionality.src/routes/docs-examples/typography/list/Description.svelte (1)
2-2: LGTM! Unused import correctly removed.The
Licomponent is not used in this file, so removing it from the import statement is appropriate and aligns with the PR objective to clean up unused imports for TypeScript'snoUnusedLocalsflag.src/routes/docs-examples/forms/phone-input/Select.svelte (1)
2-2: LGTM! Correct removal of unused import.The
PhoneInputimport was not used anywhere in the component. This cleanup aligns with the PR objective to satisfy TypeScript'snoUnusedLocalscompiler flag.src/routes/docs-examples/forms/toggle/Disabled.svelte (1)
2-2: LGTM! Unused imports removed correctly.The removal of
InputandLabelimports aligns with the PR's goal to satisfy TypeScript'snoUnusedLocalsflag. The remaining imports (ButtonandToggle) are both actively used in the component.src/routes/docs-examples/forms/input-field/Icon.svelte (1)
2-2: LGTM! Unused import correctly removed.The removal of
Buttonfrom the import statement is appropriate, as it's not used anywhere in the template. All remaining imports (Label,Input,CloseButton) are actively used in the component. This change correctly addresses thenoUnusedLocalsTypeScript compiler flag.src/routes/docs-examples/components/datepicker/Local.svelte (1)
2-2: LGTM! Unused import removed.The removal of the unused
Pimport correctly addresses thenoUnusedLocalsTypeScript compiler flag requirement while preserving the necessaryDatepickerimport.src/routes/docs-examples/forms/number-input/Counter.svelte (1)
2-2: LGTM! Unused import correctly removed.The
ButtonGroupimport has been removed as it's not used anywhere in this component. This change correctly addresses the TypeScriptnoUnusedLocalscompiler flag.src/routes/docs-examples/components/clipboard/CopyButton.svelte (1)
2-2: LGTM! Unused imports correctly removed.The
TooltipandButtonGroupimports have been removed as neither is used in this component. This change correctly addresses the TypeScriptnoUnusedLocalscompiler flag.src/routes/docs-examples/components/card/Horizontal.svelte (1)
2-2: LGTM! Unused import correctly removed.The
Buttonimport was not used anywhere in this component. Removing it correctly addresses thenoUnusedLocalsTypeScript compiler option.src/routes/docs-examples/components/buttons/Colored.svelte (1)
2-2: LGTM! Unused import correctly removed.The
Buttonimport was not used anywhere in this component. Removing it correctly addresses thenoUnusedLocalsTypeScript compiler option.src/routes/docs-examples/components/sidebar/AlwaysOpen.svelte (1)
2-2: LGTM! Unused import correctly removed.The removal of
SidebarButtonfrom the import list is correct, as it's not used anywhere in this component. This change directly addresses the PR's objective to fixnoUnusedLocalscompiler errors.src/routes/blocks/utils/Footer.svelte (1)
3-3: LGTM! Unused import correctly removed.The
FooterIconimport has been removed as it's not used anywhere in this component. This change correctly addresses the PR objective of satisfying TypeScript'snoUnusedLocalscompiler flag.src/routes/docs-examples/components/banner/Onclose.svelte (1)
13-13: LGTM! Correct handling of unused parameter.The underscore prefix correctly indicates the parameter is intentionally unused. Since the Banner component's interface requires the handler to accept a MouseEvent parameter, the parameter must remain in the signature even though the implementation doesn't need it.
src/routes/docs-examples/components/sidebar/OnClickHandler.svelte (1)
4-4: LGTM! Unused variable correctly removed.The removal of the unused
spanClassvariable directly addresses the PR objective to satisfy TypeScript'snoUnusedLocalsflag. No references to this variable exist in the component markup.src/routes/docs-examples/forms/textarea/Chatroom.svelte (1)
2-2: LGTM! Unused imports correctly removed.The removal of
AlertandLabelfrom the import statement is correct—neither component is used in the template. Note that line 7 uses the native HTML<label>element, not theLabelcomponent from flowbite-svelte. All remaining imports (Textarea,ToolbarButton) are actively used.src/routes/docs-examples/components/rating/Count.svelte (1)
2-2: LGTM! Clean removal of unused imports.The import statement now correctly includes only the
Ratingcomponent that is actually used in this file, removing the unusedAdvancedRatingandScoreRatingimports. This cleanup aligns perfectly with the PR objective to satisfy TypeScript'snoUnusedLocalsflag.src/routes/docs-examples/components/table/Search.svelte (1)
2-2: LGTM! Unused import correctly removed.The
Tablecomponent was not used anywhere in this file. The template usesTableSearchas the wrapper component along with the other imported subcomponents, making this cleanup appropriate.src/routes/docs-examples/components/table/Data.svelte (1)
2-2: LGTM! Unused imports correctly removed.The file only uses the
Tablecomponent with the shorthand{items}prop syntax. The previously imported subcomponents (TableBody,TableBodyCell,TableBodyRow,TableHead,TableHeadCell) were not used anywhere in the template, making this cleanup appropriate.src/routes/docs-examples/extend/virtual-list/LargeDataset.svelte (1)
48-48: LGTM! Correct unused parameter convention.Renaming
indexto_indexproperly indicates an intentionally unused parameter, resolving the TypeScriptnoUnusedParameterswarning without affecting functionality.src/routes/docs-examples/extend/virtual-list/InteractiveItems.svelte (1)
46-46: LGTM! Correct unused parameter convention.The underscore prefix correctly indicates the
indexparameter is intentionally unused, satisfying TypeScript'snoUnusedParametersrequirement.src/routes/docs-examples/extend/virtual-list/VariableHeights.svelte (1)
28-28: LGTM! Correct unused parameter convention.Prefixing with underscore appropriately signals the
indexparameter is intentionally unused, resolving the TypeScriptnoUnusedParameterswarning.src/routes/builder/layout/+page.svelte (1)
18-18: LGTM! Unused variable removed.The removal of the unused
dirNamevariable correctly addresses the TypeScriptnoUnusedLocalsrequirement and improves code cleanliness.src/routes/admin-dashboard/(sidebar)/quickstart/+page.svelte (1)
2-2: LGTM! Clean import statement.All imported components (
Breadcrumb,BreadcrumbItem,Heading) are actively used in the template. The removal of unused imports aligns with the PR objective to satisfy TypeScript'snoUnusedLocalscompiler flag.src/routes/docs-examples/forms/select/Dropdown.svelte (1)
8-17: LGTM: Unused array removed correctly.The removal of the unused
countriesarray correctly addresses the PR objective of satisfying TypeScript'snoUnusedLocalscompiler option. Thestatesarray is retained and properly used in the Select component on line 44. All imports and remaining code are actively used in the markup.src/routes/docs-examples/utilities/toolbar/Colored.svelte (1)
2-2: LGTM – Unused import removed.The removal of
ToolbarGroupis correct; it's not referenced anywhere in the file.src/routes/docs-examples/forms/textarea/Comment.svelte (1)
2-2: LGTM – Unused import removed.The removal of
ToolbarGroupis correct; it's not referenced anywhere in the file.src/routes/docs-examples/utilities/toolbar/CommentBox.svelte (1)
2-2: LGTM – Unused import removed.The removal of
ToolbarGroupis correct; it's not referenced anywhere in the file.src/routes/docs-examples/utilities/toolbar/Default.svelte (1)
2-2: LGTM – Unused import removed.The removal of
ToolbarGroupis correct; it's not referenced anywhere in the file.src/routes/builder/skeleton/+page.svelte (1)
69-69: LGTM! Unused variable cleanup successful.The removal of the TestimonialPlaceholder-related declarations correctly addresses the TypeScript
noUnusedLocalsrequirement. Since no TestimonialPlaceholder component is imported or used elsewhere in the file, this cleanup is safe and appropriate.src/lib/forms/tags/Tags.svelte (1)
152-154: Good addition: error message is now displayed to users.This change properly addresses the unused
errorMessagevariable that was being set throughout the code (lines 67, 76, 81, 90, 101, 111) but never rendered. The error display uses consistent styling with other error messages and provides important validation feedback to users.src/routes/builder/banner/+page.svelte (1)
23-24: Removal of unusedchangeClassaligns with PR objectives.The cleanup correctly removes the unused
changeClasshelper that was never wired to any UI control, satisfying thenoUnusedLocalscompiler requirement.However,
bannerClassis now hardcoded to"absolute"with no user customization option. Unlikecolor(lines 124-128) andtransition(lines 129-134), there are no UI controls for modifying the banner's class.If class customization is intended functionality for this builder, consider adding UI controls (e.g., radio buttons or a select input) to allow users to modify
bannerClass. Otherwise, this cleanup is appropriate.src/routes/docs-examples/components/drawer/Position.svelte (1)
2-2: LGTM! Unused import correctly removed.CloseButton was not used in this component. The cleanup satisfies the
noUnusedLocalsrequirement.src/routes/docs-examples/components/drawer/NonModal.svelte (1)
2-2: LGTM! Unused import correctly removed.The
Acomponent was not used (line 18 uses a native<a>tag). The cleanup satisfies thenoUnusedLocalsrequirement.src/routes/docs-examples/components/drawer/Enabled.svelte (1)
2-2: LGTM! Unused imports correctly removed.CloseButton and
Awere not used in this component. The cleanup satisfies thenoUnusedLocalsrequirement.src/routes/docs-examples/components/drawer/Disabled.svelte (1)
2-2: LGTM! Unused imports correctly removed.None of the removed imports (
findAllByTestId,CloseButton,A) were used in this component. The cleanup satisfies thenoUnusedLocalsrequirement.src/routes/docs-examples/components/drawer/Top.svelte (1)
2-2: LGTM! Unused import correctly removed, used imports retained.CloseButton was not used, while
Ais correctly retained (used on line 23). The cleanup satisfies thenoUnusedLocalsrequirement.src/routes/docs-examples/components/drawer/Bottom.svelte (1)
2-2: LGTM! Unused imports correctly removed.CloseButton and
Awere not used in this component. The cleanup satisfies thenoUnusedLocalsrequirement.src/routes/docs-examples/components/drawer/Contact.svelte (1)
2-2: LGTM! Unused import correctly removed.Checkbox was not used in this component. The cleanup satisfies the
noUnusedLocalsrequirement.src/routes/docs-examples/components/drawer/Left.svelte (1)
2-2: LGTM! Unused imports correctly removed.CloseButton, Label, and Textarea were not used in this component. The cleanup satisfies the
noUnusedLocalsrequirement.src/routes/docs-examples/components/drawer/OnlyOutside.svelte (1)
2-2: LGTM! Unused import correctly removed.The
CloseButtonimport has been removed as it's not used anywhere in the template. All remaining imports (Drawer,Button, and the icon components) are actively used. This cleanup correctly addresses thenoUnusedLocalsTypeScript compiler flag.src/routes/docs-examples/components/drawer/Right.svelte (1)
2-2: LGTM! Unused import correctly removed.The
CloseButtonimport has been removed as it's not referenced in the component. All remaining imports are actively used in the template and script logic.src/routes/docs-examples/components/drawer/Scrolling.svelte (1)
2-2: LGTM! Unused import correctly removed.The
CloseButtonimport has been removed as it's not used in this component. All remaining imports are properly utilized in the template.src/routes/builder/device-mockup/+page.svelte (1)
2-2: LGTM! Import cleanup aligns with PR objectives.The removal of
uiHelpersand retention of only the necessary imports (DeviceMockup,Label,Radio) correctly supports thenoUnusedLocalsgoal. All remaining imports are used in the component.src/routes/builder/utils/DynamicCodeBlockHighlight.svelte (1)
2-2: LGTM! Unused import removed.The
HighlightSvelteimport was never referenced in this component. OnlyHighlightis used on line 64.src/routes/builder/radio/+page.svelte (1)
77-80: LGTM! Simplified code block state management.The removal of unused
codeBlockandexampleExpandstate variables (per the AI summary) streamlines this component. The remainingbuilderExpandstate synchronized viabuilder.isOpenis sufficient for theDynamicCodeBlockHighlightusage on lines 112-113.src/routes/builder/heading/+page.svelte (1)
36-46: LGTM! Consistent with PR-wide simplification.The cleanup of unused DynamicCodeBlock scaffolding aligns with the systematic refactor across builder pages. The preserved
builderExpandstate and its synchronization withbuilder.isOpenmaintain full functionality for the code block display on lines 71-73.src/routes/builder/toggle/+page.svelte (1)
57-60: LGTM! Aligned with the broader builder refactor.Removing the unused
codeBlockandexampleExpandstate follows the same pattern applied across other builder pages in this PR. The component retains all necessary functionality throughbuilderExpand.src/routes/builder/select/+page.svelte (1)
72-75: LGTM! Completes the systematic cleanup.The removal of unused imports (
Component,HighlightCompo) and DynamicCodeBlock state variables matches the refactor pattern across all builder pages. The simplified initialization keeps the builder functional while satisfying TypeScript'snoUnusedLocalsrequirement.src/routes/docs/plugins/examples/datatable/Callback.svelte (2)
25-27: LGTM! Unused parameter removed.The removal of the unused
dataTableparameter aligns with the PR objective to satisfy TypeScript'snoUnusedParameterscompiler option. The function body only usescolumnanddirection, so this cleanup is appropriate.
33-35: LGTM! Unused parameters removed.The removal of the unused
eventanddataTableparameters is correct and aligns with the PR objective. The function body only usesrowIndex, making this cleanup appropriate for satisfying TypeScript'snoUnusedParameterscompiler option.src/routes/admin-dashboard/(sidebar)/+layout.svelte (1)
6-6: LGTM! Clean removal of unuseddataprop.The simplified props destructuring correctly removes the unused
dataproperty while retaining the necessarychildrenprop.src/routes/admin-dashboard/(sidebar)/Frame.svelte (1)
31-31: LGTM! Correct removal of unused type import.
HTMLAnchorAttributeswas not referenced anywhere in the component. The Props interface extends onlyHTMLAttributes<HTMLElement>, making this import unnecessary.src/routes/admin-dashboard/(sidebar)/Navbar.svelte (1)
15-20: LGTM! Clean props interface simplification.The removal of the unused
fluidparameter streamlines the component's public API. Both remaining props (drawerHiddenandlist) are actively used in the template.src/routes/admin-dashboard/(sidebar)/Sidebar.svelte (2)
5-5: LGTM! Clean removal of unused icon imports.
FireOutlineandBookOpenOutlineare not referenced in the component template or logic.
27-31: LGTM! Correct simplification ofafterNavigatecallback.The parameterless callback form is appropriate since the
Navigationparameter was unused. The callback now correctly focuses on UI side-effects (scroll to top and close drawer).src/lib/step-indicator/StepIndicator.svelte (1)
36-36: LGTM! Valid cleanup of unused loop variable.The loop variable is correctly prefixed with an underscore to indicate it's intentionally unused, while the index
iis properly utilized throughout the template.src/routes/admin-dashboard/(no-sidebar)/playground/stacked/Playground.svelte (1)
26-26: LGTM! Correctly removed unused index parameter.The index is not needed for rendering the four identical empty cards.
src/lib/stepper/DetailedStepper.svelte (1)
21-21: LGTM! Properly removed unused index binding.The index parameter was never referenced in the template, so removing it satisfies the TypeScript compiler constraints.
src/lib/stepper/VerticalStepper.svelte (1)
21-21: LGTM! Properly removed unused index binding.The index parameter was never referenced in the template, so removing it satisfies the TypeScript compiler constraints.
src/lib/carousel/Carousel.svelte (2)
60-74: LGTM! Correctly removed unused node parameter.The
loopfunction operates as an effect wrapper that manages the autoplay interval timer. It doesn't require the DOM node reference, so removing the unused parameter is appropriate for satisfying the TypeScript compiler constraints. The function is used with{@attach loop}on line 176, which appears to work correctly with the parameterless signature.
127-163: LGTM! Correctly removed unused event parameter.The
onDragStophandler doesn't need the event parameter since it relies on closure state (activeDragGesture,touchEvent,percentOffset) that's already tracked during the drag lifecycle. Removing the unused parameter is correct.src/routes/builder/textarea/+page.svelte (1)
73-75: LGTM: Clean removal of unused variable.The removal of the
exampleExpandassignment simplifies the reactive effect to only synchronizebuilderExpandwithbuilder.isOpen, which aligns with the PR objective of cleaning up unused locals.src/routes/docs-examples/components/modal/Events.svelte (1)
8-8: LGTM! Unused event parameters correctly removed.The
onsubmitandoncancelhandlers didn't use their event parameters, so converting them to parameterless functions satisfiesnoUnusedParameters. Theonclosehandler correctly retains its parameter since it accessesev.target.src/routes/docs-examples/components/modal/Crypto.svelte (1)
2-2: LGTM! Unused imports removed.The cleanup removes unused imports while correctly retaining
Pwhich is used on line 15.src/routes/docs-examples/forms/input-field/EventHandlers.svelte (1)
10-11: LGTM! Unused event parameters correctly removed.The
onfocusandonblurhandlers didn't access their event parameters, so converting them to parameterless functions is appropriate. Handlers that do use the event (lines 9, 12-16) correctly retain their parameters.src/lib/toast/Toast.svelte (1)
33-37: LGTM! Unused parameter removed.The
_closefunction didn't use itsMouseEventparameter, so removing it satisfiesnoUnusedParameters. The function body only dispatches a custom event and updates state.src/lib/mega-menu/MegaMenu.svelte (1)
4-4: LGTM! Unused import removed.The
LinkTypeimport was unused, so removing it satisfiesnoUnusedLocals. The component's functionality remains intact.src/routes/blocks/utils/SectionHeader.svelte (1)
11-11: LGTM! Unused rest props removed.The
restPropswasn't used anywhere in the template, so removing it from the destructuring satisfiesnoUnusedLocals.src/routes/docs-examples/components/modal/Popup.svelte (1)
2-2: LGTM! Unused import removed.The
Pcomponent wasn't used in the template, so removing it from the import satisfiesnoUnusedLocals.src/routes/blocks/utils/Sectioncompo.svelte (1)
75-75: LGTM! Unused destructured variable removed.The
no_of_componentsfield was destructured but never used in the loop bodies. Removing it from the destructuring satisfiesnoUnusedLocalswhile preserving the type definition.Also applies to: 79-79
src/lib/navbar/NavHamburger.svelte (1)
21-23: LGTM: Handler simplified to parameterless form.The toggle function correctly removes the unused event parameter while preserving the state mutation logic. This aligns with the PR's objective to satisfy
noUnusedParameters.src/routes/builder/range/+page.svelte (1)
43-43: LGTM: Whitespace cleanup.The removal of the empty line is appropriate for code cleanliness.
src/routes/docs-examples/components/toast/Transitions.svelte (1)
4-4: LGTM: Unused import removed.The removal of
elasticOutis correct since it's not used in any of the toast components. ThequintOutimport is retained as it's used on line 15.src/lib/badge/Badge.svelte (1)
23-27: LGTM: Handler simplified to parameterless form.The close function correctly removes the unused event parameter. The function creates its own
Eventobject internally (line 24), so accepting an external event parameter was unnecessary.src/lib/alert/Alert.svelte (1)
28-32: LGTM: Handler simplified to parameterless form.The close function correctly removes the unused parameter. Since it creates its own
Eventobject internally (line 29), accepting an external parameter was unnecessary.src/routes/blocks/utils/PageHeadSection.svelte (1)
10-10: LGTM: Unused props removed from destructuring.The
dirandbreadcrumb_titleprops are not used in the component template (lines 14-18), so removing them from the destructuring is correct. The Props interface (lines 4-9) still declares them as optional, maintaining backward compatibility with callers.src/routes/docs-examples/components/navbar/Search.svelte (1)
8-8: Review comment is incorrect.The
NavContainerparameter has not been removed from the Navbar slot signature. It remains in the component's type definition (src/lib/types.ts) and continues to be passed by Navbar.svelte ({@render children({ hidden: navState.hidden, toggle, NavContainer })}).The change in Search.svelte simply removes it from the destructuring pattern because the example never used it—this is safe cleanup of an unused variable. No other navbar examples in the codebase reference NavContainer, so there are no consumers relying on it in this pattern.
Likely an incorrect or invalid review comment.
src/routes/docs-examples/forms/timepicker/Drawer.svelte (1)
3-3: LGTM! Unused import removed.The
CloseOutlineimport has been correctly removed as it's not used anywhere in the component.src/lib/dialog/Dialog.svelte (2)
17-17: LGTM! Simplified close function signature.The
closefunction correctly removes the unuseddlgparameter. All call sites have been updated consistently throughout the file.
115-122: LGTM! Simplified close_handler signature.The
close_handlerfunction correctly removes the unusedMouseEventparameter, maintaining the same behavior of dispatching a cancel event.src/lib/forms/input-field/Input.svelte (2)
106-113: LGTM! Unused parameter correctly marked.The
_eventparameter is prefixed with an underscore to indicate it's intentionally unused, which is the correct approach when the function signature must match but the parameter isn't needed.
115-127: LGTM! Simplified internal handler signatures.Both
defaultHandleFocusanddefaultHandleBlurcorrectly remove unused event parameters while maintaining their functionality. The call sites at lines 177 and 184 have been updated accordingly.src/routes/docs-examples/components/mega-menu/Default.svelte (1)
27-34: Verify that MegaMenu functions correctly without explicit state management.Similar to the Transition example, the removal of the
openstate andonclickhandler suggests thatMegaMenumanages its own state. Ensure the mega menu still opens/closes correctly on user interaction.This can be verified using the same script from the Transition.svelte review.
src/lib/types.ts (1)
795-801: Verification complete: No breaking change risk detected.The search for explicit generic usage of
PhoneInputPropsfound no matches. The only code reference (inPhoneInput.svelte:7) uses the interface as a plain type annotation without specifying any generic parameters. The removal of the unused generic parameterTpresents no breaking change within this codebase.src/routes/docs-examples/components/mega-menu/Transition.svelte (1)
28-51: No issues found—Popper auto-detects the trigger correctly.The MegaMenu component relies on Popper's automatic trigger detection. When Popper initializes without an explicit
triggeredByprop, it checks for apreviousElementSibling(lines 155–157 of Popper.svelte). In the Transition.svelte example, the NavLi element is positioned immediately before each MegaMenu, making it the previous sibling. Popper automatically binds click handlers to this NavLi, so the menu opens and closes correctly without requiring explicit state management or onclick handlers in the template.Likely an incorrect or invalid review comment.
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/lib/forms/tags/Tags.svelte (1)
130-130: Remove the empty<svelte:window />tag.This tag serves no purpose without event handlers attached. Since the window event listeners were removed in favor of the reactive
$effectapproach for dropdown positioning, this tag can be deleted.Apply this diff:
-<svelte:window /> -
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
src/lib/forms/tags/Tags.svelte(3 hunks)src/lib/tooltip/Tooltip.svelte(0 hunks)src/routes/admin-dashboard/(sidebar)/Sidebar.svelte(2 hunks)src/routes/builder/layout/+page.svelte(1 hunks)src/routes/builder/textarea/+page.svelte(3 hunks)src/routes/docs/plugins/examples/datatable/Callback.svelte(1 hunks)
💤 Files with no reviewable changes (1)
- src/lib/tooltip/Tooltip.svelte
🚧 Files skipped from review as they are similar to previous changes (3)
- src/routes/admin-dashboard/(sidebar)/Sidebar.svelte
- src/routes/builder/layout/+page.svelte
- src/routes/builder/textarea/+page.svelte
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Playwright and Lint
🔇 Additional comments (4)
src/lib/forms/tags/Tags.svelte (2)
144-146: LGTM! Good addition for user feedback.The dedicated error message rendering provides clear validation feedback to users and complements the existing helper messages nicely.
163-163: LGTM!The input element bindings and event handlers are properly configured with no unused parameters.
src/routes/docs/plugins/examples/datatable/Callback.svelte (2)
29-31: LGTM! Great type improvement.The removal of the unused
dataTableparameter is correct. Additionally, changing the type fromany[]totypeof itemsprovides better type safety.
33-35: LGTM!The removal of unused
eventanddataTableparameters is correct and aligns perfectly with the PR objectives.
| function handleSort(column: number, direction: string): void { | ||
| console.log(`Column ${column} sorted ${direction}`); | ||
| } |
There was a problem hiding this comment.
🧩 Analysis chain
Verify the signature matches Table component expectations.
The removal of the unused dataTable parameter is correct and aligns with the PR objectives. Ensure that the onSort prop of the Table component accepts this simplified signature.
Run the following script to verify the Table component's type definitions:
🏁 Script executed:
#!/bin/bash
# Description: Check the Table component's onSort prop type definition
# Search for the Table component's prop type definitions
ast-grep --pattern 'onSort$$$'
# Also search for DataTable type definitions related to sort handlers
rg -nP --type=ts -C3 'onSort.*\??\s*:\s*\('Length of output: 0
🏁 Script executed:
#!/bin/bash
# First, examine the Callback.svelte file to see how Table is used and imported
echo "=== Examining Callback.svelte file ==="
cat src/routes/docs/plugins/examples/datatable/Callback.svelte
echo -e "\n=== Searching for Table component definition ==="
# Search for Table component files
fd -e svelte -e ts -e tsx -e js | grep -i table
echo -e "\n=== Searching for component files in plugins directory ==="
fd -e svelte src/routes/docs/plugins/Length of output: 5403
🌐 Web query:
@flowbite-svelte-plugins/datatable onSort callback signature
💡 Result:
Signature (TypeScript):
typescriptonSort?: (column: number, direction: string, dataTable: DataTable) => void. [1]
Signature mismatch: handleSort must accept dataTable parameter to match Table component expectations.
The @flowbite-svelte-plugins/datatable Table component's onSort prop expects a callback with signature (column: number, direction: string, dataTable: DataTable) => void. The current implementation only accepts (column: number, direction: string), creating a type incompatibility.
The dataTable parameter must be restored to the function signature:
function handleSort(column: number, direction: string, dataTable: DataTable): void {
console.log(`Column ${column} sorted ${direction}`);
}🤖 Prompt for AI Agents
In src/routes/docs/plugins/examples/datatable/Callback.svelte around lines 25 to
27, the handleSort function signature is missing the third dataTable parameter
required by the Table component; update the declaration to accept (column:
number, direction: string, dataTable: DataTable) and adjust any internal
references (or ignore the parameter if unused) so the function matches the Table
onSort callback type and resolves the type incompatibility.
Closes #1803
📑 Description
Status
✅ Checks
api-checkdirectory as requiredpnpm check && pnpm test:e2eSummary by CodeRabbit
New Features
Improvements
Changes
Refactor / Chores