Skip to content

fix: clear Obsidian review action errors in library code - #1

Merged
Quorafind merged 1 commit into
mainfrom
fix/review-action-errors
Nov 28, 2026
Merged

Quorafind merged 1 commit into
mainfrom
fix/review-action-errors

Conversation

@Quorafind

Copy link
Copy Markdown
Member

Why

Task Genius bundles this library into its Obsidian plugin. The plugin's CI runs the Obsidian review action (obsidianmd/obsidian-workflows), which lints the checked-out submodule as well. In strict mode, error-level findings fail the job. Library code had 10 of them (taskgenius/taskgenius-plugin#667).

Changes

  • DateFnsAdapter: replaces type DateFns = any and its restricted eslint-disable for no-explicit-any with an exported structural DateFnsFunctions interface. It lists the ~40 date-fns functions the adapter calls.
    • Nothing is imported, so date-fns stays an optional peer.
    • I type-checked new DateFnsAdapter(dateFns) against the real date-fns 2.30, 3.6 and 4.1 modules, and it passes for all three.
    • Side effect: about 170 no-unsafe-* warnings from the any are gone.
  • MonthRenderer: the two no-unused-vars disables now have -- reason descriptions.
  • DragController:
    • Toggles body.tg-is-dragging (CSS cursor: grabbing) instead of writing body.style.cursor.
    • Hides the drag proxy with setStyles, matching the visibility: "visible" that onMove sets.
  • Month/Time "more" popovers: clickable items get .tg-is-clickable (CSS cursor: pointer) instead of style.cursor = "pointer".
  • TimeRenderer: the slot-based column height goes through .tg-day-column.tg-has-slot-height { height: var(--tg-column-height) } instead of an inline height.

Verification

  • tsc --noEmit passes.
  • vitest run: 20 files / 291 tests pass.
  • vite build passes.
  • The review action's ESLint config, run locally with its pinned versions (eslint 9.37.0, eslint-plugin-obsidianmd 0.4.1, typescript-eslint 8.61.1), finds 0 errors in src/.

Task Genius bundles this library into its Obsidian plugin, and the
Obsidian review action (obsidianmd/obsidian-workflows) fails strict
runs on these error-level findings.

- DateFnsAdapter: replace `type DateFns = any` (and its restricted
  eslint-disable for no-explicit-any) with a structural
  DateFnsFunctions interface for the date-fns functions the adapter
  calls. Nothing is imported, so date-fns stays an optional peer;
  date-fns 2.30, 3.6 and 4.1 modules all satisfy it.
- MonthRenderer: describe the two no-unused-vars disables.
- DragController: toggle body.tg-is-dragging instead of writing
  body.style.cursor; hide the drag proxy with setStyles, matching the
  visibility: visible that onMove sets.
- Month/Time renderers: mark clickable popover items with
  .tg-is-clickable instead of style.cursor = "pointer".
- TimeRenderer: apply the slot-based column height through
  .tg-day-column.tg-has-slot-height instead of an inline height.
@Quorafind
Quorafind merged commit a04bb2b into main Nov 28, 2026
4 checks passed
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.

1 participant