Skip to content

fix: #1803 cleanups for noUnusedLocals and noUnusedParameters#1804

Merged
shinokada merged 2 commits intothemesberg:mainfrom
shinokada:fix/unusedlocals
Oct 26, 2025
Merged

fix: #1803 cleanups for noUnusedLocals and noUnusedParameters#1804
shinokada merged 2 commits intothemesberg:mainfrom
shinokada:fix/unusedlocals

Conversation

@shinokada
Copy link
Copy Markdown
Collaborator

@shinokada shinokada commented Oct 26, 2025

Closes #1803

📑 Description

Status

  • Not Completed
  • Completed

✅ Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation and api-check directory as required
  • All the tests and check have passed by running pnpm check && pnpm test:e2e
  • My pull request is based on the latest commit (not the npm version).
  • I have checked the page with https://validator.unl.edu/

Summary by CodeRabbit

  • New Features

    • Tags now show validation error messages inline for clearer feedback.
  • Improvements

    • Timepicker no longer auto-closes after selecting/applying a range.
  • Changes

    • Modal builder UI simplified by removing several advanced toggle options.
  • Refactor / Chores

    • Numerous components cleaned up: simplified event handlers, removed unused props/imports and dead code for leaner templates.

@vercel
Copy link
Copy Markdown

vercel bot commented Oct 26, 2025

@shinokada is attempting to deploy a commit to the Themesberg Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Oct 26, 2025

Walkthrough

Mass 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

Cohort / File(s) Summary
Dismiss/Close handler simplification
src/lib/alert/Alert.svelte, src/lib/badge/Badge.svelte, src/lib/toast/Toast.svelte, src/lib/dialog/Dialog.svelte
Removed event/element parameters from close handlers and related handler signatures; call sites updated to invoke parameterless close functions while preserving dispatch/state-update logic.
Carousel handler / loop signature changes
src/lib/carousel/Carousel.svelte
Removed node parameter from loop and removed event parameter from onDragStop derived handler.
Input & form handler refactor
src/lib/forms/input-field/Input.svelte, src/routes/docs-examples/forms/input-field/EventHandlers.svelte
Focus/blur/input handlers changed to parameterless or renamed unused params; added keyboard-navigation/backspace reset logic on blur/input.
Tags & Timepicker state adjustments
src/lib/forms/tags/Tags.svelte, src/lib/forms/timepicker/Timepicker.svelte
Removed dropdown positioning handlers and oninput; removed dropdownOpen state so selection/apply no longer auto-closes.
Navbar / Hamburger toggle
src/lib/navbar/NavHamburger.svelte
Toggle handler changed to parameterless function (event removed).
MegaMenu / Tooltip / Rating / Types
src/lib/mega-menu/MegaMenu.svelte, src/lib/tooltip/Tooltip.svelte, src/lib/rating/Review.svelte, src/lib/types.ts
Removed unneeded imports/type aliases (LinkType), removed theme getTheme call, removed class alias in Review props, and removed generic parameter from PhoneInputProps.
Loop variable / unused var removals
src/lib/step-indicator/StepIndicator.svelte, src/lib/stepper/.../DetailedStepper.svelte, src/lib/stepper/.../VerticalStepper.svelte, src/routes/.../Playground.svelte, src/routes/docs-examples/.../VirtualList*.svelte, src/routes/docs-examples/components/carousel/Caption.svelte, src/routes/docs-examples/components/clipboard/ApiKeys.svelte
Renamed unused loop/index variables to underscore variants or removed them; removed unused state declarations.
Admin dashboard / Sidebar / Navbar layout cleanup
src/routes/admin-dashboard/(sidebar)/+layout.svelte, .../Navbar.svelte, .../Sidebar.svelte, .../Frame.svelte, .../productdrawer/+page.svelte
Removed Route/data/docsRoute props, activeUrl/activeMainSidebar state and related navigation logic; removed unused imports and eager import usage.
Builder pages: DynamicCodeBlock & helpers removed
src/routes/builder/**/+page.svelte (many files: banner, blockquote, button, card, device-mockup, drawer, dropdown, heading, image, link, modal, popover, radio, range, select, skeleton, textarea, toggle, etc.)
Removed DynamicCodeBlock scaffolding (codeBlock, exampleExpand, effects), unused uiHelpers/gradientBuilder/dirName, and several builder-specific state variables/handlers.
Docs examples: import / param reductions
src/routes/docs-examples/components/**, src/routes/docs-examples/forms/**, src/routes/docs-examples/utilities/**, src/routes/docs-examples/extend/**, src/routes/docs-examples/.../Navbar/Search.svelte, src/routes/docs-examples/components/datepicker/ActionSlot.svelte, src/routes/docs/plugins/examples/datatable/Callback.svelte
Removed numerous unused imports (CloseButton, Button, Checkbox, ToolbarGroup, etc.), simplified slot prop passing, removed unused local vars, and reduced datatable callback parameter lists.
Blocks utils & fetchPost cleanup
src/routes/blocks/utils/*.svelte, src/routes/blocks/utils/fetchPost.ts, src/routes/blocks/+page.svelte
Eliminated duplicate/shadowed declarations, removed unused imports (MetaTag, FooterIcon), and removed import.meta.glob usage for example markdown files.
Misc minor cleanups
assorted files across routes and examples (many small import/var removals)
Trimmed unused imports, types, easing functions, and local constants in multiple example and utility files.

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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • High file count but highly repetitive patterns (unused-parameter/import removal).
  • Review attention points:
    • src/lib/dialog/Dialog.svelte — verify dialog close/cancel behavior across call sites.
    • src/lib/forms/input-field/Input.svelte — confirm focus/blur and suggestion/backspace state correctness.
    • src/lib/carousel/Carousel.svelte — ensure loop/onDragStop behavior unchanged.
    • src/lib/types.ts — public API change: removal of PhoneInputProps generic may affect consumers.

Possibly related PRs

  • Dismissable #1700 — similar dismiss/close refactors across Alert/Badge/Toast/Dialog components.
  • Dialog #1723 — touches Dialog.svelte and close/click handling; potential overlap with dialog refactor here.
  • fix: types clean up #1609 — type/interface cleanup including edits to src/lib/types.ts.

Poem

🐰
I hopped through code both near and far,
Nibbled unused bits — adieu, old param!
_index, _event — neat as a pin,
TypeScript smiles, the tests begin. 🎩✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The PR description is largely incomplete despite following the template structure. While the issue reference "Closes #1803" is present and the status is marked as Completed, the critical "📑 Description" section contains only an empty HTML comment placeholder with no actual explanation of the changes. Although the Checks section is completed, the absence of a meaningful description makes it difficult to understand the scope and rationale of the changes without examining the raw diff. Please add a meaningful description in the "📑 Description" section explaining what cleanup was performed. At minimum, describe the types of changes made (e.g., removal of unused parameters, elimination of unused local variables, unused imports) and summarize the scope of affected files.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The PR title "fix: #1803 cleanups for noUnusedLocals and noUnusedParameters" is clear, concise, and directly related to the main changeset. It references the issue being fixed and accurately describes the primary change: cleanup of unused locals and parameters to comply with TypeScript compiler options. The title is specific enough that a developer scanning history would understand the purpose without ambiguity.
Linked Issues Check ✅ Passed The code changes comprehensively address the primary objective of issue #1803. The raw summary shows removal of unused parameters across multiple component files (Alert, Badge, Carousel, Dialog, Input, Toast, Tooltip, etc.), elimination of unused local variables, and removal of unused imports. These changes directly resolve TypeScript compiler errors from the noUnusedLocals and noUnusedParameters options that were blocking the issue. The modifications follow best practices by renaming unused parameters with underscore prefixes when appropriate (e.g., _event, _index) to maintain code clarity.
Out of Scope Changes Check ✅ Passed All observed changes are directly aligned with the scope defined in issue #1803. The modifications consist solely of removing unused parameters, eliminating unused local variables, dropping unused imports, and renaming unused variables to follow underscore conventions—all necessary to resolve TypeScript compiler errors for noUnusedLocals and noUnusedParameters. No functional behavior changes, feature additions, or unrelated refactoring patterns are present. The changes are minimal and focused exclusively on satisfying the compiler options.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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.params to 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 paramsString should use paramValues:

       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-[188px instead of w-[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 unused MouseEventHandler import.

The MouseEventHandler type is no longer used after simplifying the toggle function 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: checkDropdownPosition is a no-op stub.

This function only checks if inputContainer exists but performs no actual work. It's being called from handleInput (line 106) and window scroll/resize events (line 138), but does nothing useful. The actual dropdown positioning logic resides in updateDropdownPosition and is managed by the $effect block.

Consider removing this stub function and its associated event handlers if dropdown positioning via autoUpdate in the $effect block 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 dataTable parameter is correct. However, the any[] type for matched reduces 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 getTheme import 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

📥 Commits

Reviewing files that changed from the base of the PR and between b92b049 and 95afa54.

📒 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 Indicator import is correct. The file only uses the Avatar component with its dot prop to display status indicators, so Indicator was indeed unnecessary.

src/routes/docs-examples/components/datepicker/ActionSlot.svelte (1)

9-9: LGTM! Unused parameter correctly removed.

The close parameter was not referenced in the snippet body, so removing it appropriately satisfies the TypeScript noUnusedParameters compiler option without affecting functionality.

src/routes/docs-examples/typography/list/Description.svelte (1)

2-2: LGTM! Unused import correctly removed.

The Li component 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's noUnusedLocals flag.

src/routes/docs-examples/forms/phone-input/Select.svelte (1)

2-2: LGTM! Correct removal of unused import.

The PhoneInput import was not used anywhere in the component. This cleanup aligns with the PR objective to satisfy TypeScript's noUnusedLocals compiler flag.

src/routes/docs-examples/forms/toggle/Disabled.svelte (1)

2-2: LGTM! Unused imports removed correctly.

The removal of Input and Label imports aligns with the PR's goal to satisfy TypeScript's noUnusedLocals flag. The remaining imports (Button and Toggle) 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 Button from 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 the noUnusedLocals TypeScript compiler flag.

src/routes/docs-examples/components/datepicker/Local.svelte (1)

2-2: LGTM! Unused import removed.

The removal of the unused P import correctly addresses the noUnusedLocals TypeScript compiler flag requirement while preserving the necessary Datepicker import.

src/routes/docs-examples/forms/number-input/Counter.svelte (1)

2-2: LGTM! Unused import correctly removed.

The ButtonGroup import has been removed as it's not used anywhere in this component. This change correctly addresses the TypeScript noUnusedLocals compiler flag.

src/routes/docs-examples/components/clipboard/CopyButton.svelte (1)

2-2: LGTM! Unused imports correctly removed.

The Tooltip and ButtonGroup imports have been removed as neither is used in this component. This change correctly addresses the TypeScript noUnusedLocals compiler flag.

src/routes/docs-examples/components/card/Horizontal.svelte (1)

2-2: LGTM! Unused import correctly removed.

The Button import was not used anywhere in this component. Removing it correctly addresses the noUnusedLocals TypeScript compiler option.

src/routes/docs-examples/components/buttons/Colored.svelte (1)

2-2: LGTM! Unused import correctly removed.

The Button import was not used anywhere in this component. Removing it correctly addresses the noUnusedLocals TypeScript compiler option.

src/routes/docs-examples/components/sidebar/AlwaysOpen.svelte (1)

2-2: LGTM! Unused import correctly removed.

The removal of SidebarButton from the import list is correct, as it's not used anywhere in this component. This change directly addresses the PR's objective to fix noUnusedLocals compiler errors.

src/routes/blocks/utils/Footer.svelte (1)

3-3: LGTM! Unused import correctly removed.

The FooterIcon import has been removed as it's not used anywhere in this component. This change correctly addresses the PR objective of satisfying TypeScript's noUnusedLocals compiler 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 spanClass variable directly addresses the PR objective to satisfy TypeScript's noUnusedLocals flag. 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 Alert and Label from the import statement is correct—neither component is used in the template. Note that line 7 uses the native HTML <label> element, not the Label component 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 Rating component that is actually used in this file, removing the unused AdvancedRating and ScoreRating imports. This cleanup aligns perfectly with the PR objective to satisfy TypeScript's noUnusedLocals flag.

src/routes/docs-examples/components/table/Search.svelte (1)

2-2: LGTM! Unused import correctly removed.

The Table component was not used anywhere in this file. The template uses TableSearch as 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 Table component 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 index to _index properly indicates an intentionally unused parameter, resolving the TypeScript noUnusedParameters warning 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 index parameter is intentionally unused, satisfying TypeScript's noUnusedParameters requirement.

src/routes/docs-examples/extend/virtual-list/VariableHeights.svelte (1)

28-28: LGTM! Correct unused parameter convention.

Prefixing with underscore appropriately signals the index parameter is intentionally unused, resolving the TypeScript noUnusedParameters warning.

src/routes/builder/layout/+page.svelte (1)

18-18: LGTM! Unused variable removed.

The removal of the unused dirName variable correctly addresses the TypeScript noUnusedLocals requirement 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's noUnusedLocals compiler flag.

src/routes/docs-examples/forms/select/Dropdown.svelte (1)

8-17: LGTM: Unused array removed correctly.

The removal of the unused countries array correctly addresses the PR objective of satisfying TypeScript's noUnusedLocals compiler option. The states array 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 ToolbarGroup is 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 ToolbarGroup is 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 ToolbarGroup is 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 ToolbarGroup is 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 noUnusedLocals requirement. 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 errorMessage variable 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 unused changeClass aligns with PR objectives.

The cleanup correctly removes the unused changeClass helper that was never wired to any UI control, satisfying the noUnusedLocals compiler requirement.

However, bannerClass is now hardcoded to "absolute" with no user customization option. Unlike color (lines 124-128) and transition (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 noUnusedLocals requirement.

src/routes/docs-examples/components/drawer/NonModal.svelte (1)

2-2: LGTM! Unused import correctly removed.

The A component was not used (line 18 uses a native <a> tag). The cleanup satisfies the noUnusedLocals requirement.

src/routes/docs-examples/components/drawer/Enabled.svelte (1)

2-2: LGTM! Unused imports correctly removed.

CloseButton and A were not used in this component. The cleanup satisfies the noUnusedLocals requirement.

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 the noUnusedLocals requirement.

src/routes/docs-examples/components/drawer/Top.svelte (1)

2-2: LGTM! Unused import correctly removed, used imports retained.

CloseButton was not used, while A is correctly retained (used on line 23). The cleanup satisfies the noUnusedLocals requirement.

src/routes/docs-examples/components/drawer/Bottom.svelte (1)

2-2: LGTM! Unused imports correctly removed.

CloseButton and A were not used in this component. The cleanup satisfies the noUnusedLocals requirement.

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 noUnusedLocals requirement.

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 noUnusedLocals requirement.

src/routes/docs-examples/components/drawer/OnlyOutside.svelte (1)

2-2: LGTM! Unused import correctly removed.

The CloseButton import 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 the noUnusedLocals TypeScript compiler flag.

src/routes/docs-examples/components/drawer/Right.svelte (1)

2-2: LGTM! Unused import correctly removed.

The CloseButton import 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 CloseButton import 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 uiHelpers and retention of only the necessary imports (DeviceMockup, Label, Radio) correctly supports the noUnusedLocals goal. All remaining imports are used in the component.

src/routes/builder/utils/DynamicCodeBlockHighlight.svelte (1)

2-2: LGTM! Unused import removed.

The HighlightSvelte import was never referenced in this component. Only Highlight is used on line 64.

src/routes/builder/radio/+page.svelte (1)

77-80: LGTM! Simplified code block state management.

The removal of unused codeBlock and exampleExpand state variables (per the AI summary) streamlines this component. The remaining builderExpand state synchronized via builder.isOpen is sufficient for the DynamicCodeBlockHighlight usage 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 builderExpand state and its synchronization with builder.isOpen maintain 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 codeBlock and exampleExpand state follows the same pattern applied across other builder pages in this PR. The component retains all necessary functionality through builderExpand.

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's noUnusedLocals requirement.

src/routes/docs/plugins/examples/datatable/Callback.svelte (2)

25-27: LGTM! Unused parameter removed.

The removal of the unused dataTable parameter aligns with the PR objective to satisfy TypeScript's noUnusedParameters compiler option. The function body only uses column and direction, so this cleanup is appropriate.


33-35: LGTM! Unused parameters removed.

The removal of the unused event and dataTable parameters is correct and aligns with the PR objective. The function body only uses rowIndex, making this cleanup appropriate for satisfying TypeScript's noUnusedParameters compiler option.

src/routes/admin-dashboard/(sidebar)/+layout.svelte (1)

6-6: LGTM! Clean removal of unused data prop.

The simplified props destructuring correctly removes the unused data property while retaining the necessary children prop.

src/routes/admin-dashboard/(sidebar)/Frame.svelte (1)

31-31: LGTM! Correct removal of unused type import.

HTMLAnchorAttributes was not referenced anywhere in the component. The Props interface extends only HTMLAttributes<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 fluid parameter streamlines the component's public API. Both remaining props (drawerHidden and list) are actively used in the template.

src/routes/admin-dashboard/(sidebar)/Sidebar.svelte (2)

5-5: LGTM! Clean removal of unused icon imports.

FireOutline and BookOpenOutline are not referenced in the component template or logic.


27-31: LGTM! Correct simplification of afterNavigate callback.

The parameterless callback form is appropriate since the Navigation parameter 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 i is 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 loop function 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 onDragStop handler 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 exampleExpand assignment simplifies the reactive effect to only synchronize builderExpand with builder.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 onsubmit and oncancel handlers didn't use their event parameters, so converting them to parameterless functions satisfies noUnusedParameters. The onclose handler correctly retains its parameter since it accesses ev.target.

src/routes/docs-examples/components/modal/Crypto.svelte (1)

2-2: LGTM! Unused imports removed.

The cleanup removes unused imports while correctly retaining P which is used on line 15.

src/routes/docs-examples/forms/input-field/EventHandlers.svelte (1)

10-11: LGTM! Unused event parameters correctly removed.

The onfocus and onblur handlers 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 _close function didn't use its MouseEvent parameter, so removing it satisfies noUnusedParameters. 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 LinkType import was unused, so removing it satisfies noUnusedLocals. The component's functionality remains intact.

src/routes/blocks/utils/SectionHeader.svelte (1)

11-11: LGTM! Unused rest props removed.

The restProps wasn't used anywhere in the template, so removing it from the destructuring satisfies noUnusedLocals.

src/routes/docs-examples/components/modal/Popup.svelte (1)

2-2: LGTM! Unused import removed.

The P component wasn't used in the template, so removing it from the import satisfies noUnusedLocals.

src/routes/blocks/utils/Sectioncompo.svelte (1)

75-75: LGTM! Unused destructured variable removed.

The no_of_components field was destructured but never used in the loop bodies. Removing it from the destructuring satisfies noUnusedLocals while 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 elasticOut is correct since it's not used in any of the toast components. The quintOut import 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 Event object 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 Event object 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 dir and breadcrumb_title props 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 NavContainer parameter 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 CloseOutline import 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 close function correctly removes the unused dlg parameter. All call sites have been updated consistently throughout the file.


115-122: LGTM! Simplified close_handler signature.

The close_handler function correctly removes the unused MouseEvent parameter, 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 _event parameter 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 defaultHandleFocus and defaultHandleBlur correctly 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 open state and onclick handler suggests that MegaMenu manages 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 PhoneInputProps found no matches. The only code reference (in PhoneInput.svelte:7) uses the interface as a plain type annotation without specifying any generic parameters. The removal of the unused generic parameter T presents 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 triggeredBy prop, it checks for a previousElementSibling (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.

@shinokada shinokada merged commit f482e6a into themesberg:main Oct 26, 2025
1 of 2 checks passed
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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 $effect approach for dropdown positioning, this tag can be deleted.

Apply this diff:

-<svelte:window />
-
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 95afa54 and 1708918.

📒 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 dataTable parameter is correct. Additionally, changing the type from any[] to typeof items provides better type safety.


33-35: LGTM!

The removal of unused event and dataTable parameters is correct and aligns perfectly with the PR objectives.

Comment on lines +25 to 27
function handleSort(column: number, direction: string): void {
console.log(`Column ${column} sorted ${direction}`);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 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.

@shinokada shinokada deleted the fix/unusedlocals branch October 29, 2025 09:01
@coderabbitai coderabbitai bot mentioned this pull request Nov 10, 2025
16 tasks
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.

Add noUnusedLocals, noUnusedParameters to tsconfig.json has more than 130 errors.

1 participant