Skip to content

fix(hooks): pre-commit lints the whole ui submodule on a pointer bump, blocking every bump #470

Closed

Description

@thinkclay

Found while fixing #444.

The pre-commit hook lints the entire packages/ui submodule whenever its pointer moves, and reports pre-existing violations as "Errors in staged files" — so it blocks the commit even when the change is only the 40-byte gitlink.

Reproduced on #444's pointer bump. 20 violations, none in any file the change touched:

lint/style/useImportType                   animation/transitions/{Fade,Scale,Slide}Transition.tsx, stories/playground/GlassTabBar.stories.tsx
lint/correctness/useExhaustiveDependencies components/Address/AddressForm.tsx (x3)
lint/suspicious/noExplicitAny              NavigationBar.styles.ts, SearchSelect/useSearchSelect.ts, Slider.tsx (x3),
                                           Table.tsx (x2), TableHeader.tsx, TableRow.tsx, Tabs.types.ts,
                                           ToolbarButton.tsx, platform/useHaptics.ts

The count is identical at the old and new pointer (20 either way), which is the proof that the bump introduces none of them:

git checkout 043505e && biome lint src | grep -c 'lint/'   # 20
git checkout 34eba3b && biome lint src | grep -c 'lint/'   # 20

As written, this blocks any packages/ui pointer bump — so every such commit has to use --no-verify, which also skips the checks that would have been useful. Same applies to packages/sdk.

Fix options: treat a gitlink-only change as not implicating the submodule's contents; or scope the lint to files actually changed within the submodule; or gate on "no new violations vs. the merge base" rather than an absolute zero. Paying down the 20 existing violations would help but does not fix the mechanism.

Activity

  1. added
    bug
    on Jul 30, 2026
  2. thinkclay commented on Aug 19, 2026

    @thinkclay
    ContributorAuthor

    Still live as of 2026-08-19, hit again on the prototype-parity pointer bump (#621, Scaffald/ui#18).

    Same shape as reported, count now 19 at the new pointer — the extra platform/useHaptics.ts entry from the original list is gone, everything else is identical. None of the flagged files are touched by the bump; the diff is five token/component files plus the gitlink.

    Both commits in that PR had to use --no-verify, which is the part that actually costs something: it skipped the formatting pass the hook would otherwise have run on the files I did change, so I had to run nx run-many -t lint by hand to get equivalent coverage. The rail is off for the whole commit, not just for the submodule.

    Suggested narrowing, in case it helps whoever takes this: the hook only needs to lint paths inside the superproject diff. A staged gitlink (mode 160000) carries no lintable content — git diff --cached --diff-filter=d --name-only filtered against git ls-files -s | awk '$1 == "160000"' would drop submodule entries before the lint step, leaving the rest of the hook intact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    DXbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions