Skip to content

chore: add fsd lint guardrails and specs before the frontend move - #93

Merged
dimslaev merged 1 commit into
masterfrom
refactor/frontend-fsd-1-guardrails
Oct 23, 2026
Merged

dimslaev merged 1 commit into
masterfrom
refactor/frontend-fsd-1-guardrails

Conversation

@dimslaev

Copy link
Copy Markdown
Owner

Chunk 1 of 6 of the frontend FSD + kebab-case move. Nothing moves yet. This PR adds the tests and linters the later chunks rely on.

Changes

  • Specs for code the later chunks touch that nothing covered:
    • feed-filters.spec.ts: each filter row (From, Topics, Published, Sort by, search) narrows the feed, and the list matches the response.
    • rails.spec.ts: on wide screens the header spans the inline rails on the feed and narrows on /profile. On mid screens the rail button shows on the feed only, and [ opens and closes the sheet but not while typing in search.
    • admin.spec.ts: an admin opens analytics from the user menu and changes the window. A reader sees "Admins only." Logged out, /admin redirects to login.
  • Steiger 0.7 with the FSD plugin, run by bun run lint:layers, plus a CI step in test-frontend.yml with continue-on-error (report only). fsd/insignificant-slice is off: Steiger only counts references from FSD layers, and routes/ isn't one, so every slice imported only by a route shows as unused.
  • Biome useFilenamingConvention (kebab-case) at warn. It passes __root.tsx, _layout.tsx, $id.tsx and foo.index.tsx without extra config.
  • ADR 3 and scripts/check-banned-module-names.sh now allow frontend/src/shared/, the FSD layer name Steiger requires. The hook still checks every name below it.
  • src/index.css: bun run lint reformats one rule that was committed unformatted on master.

Findings from the spike

  • Steiger accepts routes/ above the layers. It catches feature→feature and upward imports. It does not catch routes/ importing past a slice's index.ts.
  • Steiger rejects files placed directly in a slice (no-segmentless-slices), so slices use ui/, model/ and lib/ segments.
  • With aliases set to @/shared/*, the shadcn CLI writes into src/shared/ui/ and rewrites imports correctly. I tested against a stub registry because ui.shadcn.com is blocked from this sandbox.
  • Two imports in the plan's mapping would be forbidden. Both are settled: LikeButton goes into features/feed, and AuthLayout becomes a pathless routes/_auth.tsx.

Checks

  • bun run build green.
  • Playwright: 44 passed on master, 55 passed on this branch (local stack: seeded db, backend, Vite).
  • pre-commit hooks pass. zizmor needs a GitHub token to run its online audits here; run offline on test-frontend.yml it reports no findings.

Generated by Claude Code

Comment thread docs/adr/0003-no-utils-module.md Resolved
@dimslaev
dimslaev merged commit 58b568e into master Oct 23, 2026
10 checks passed
@dimslaev
dimslaev deleted the refactor/frontend-fsd-1-guardrails branch October 23, 2026 17:38
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.

2 participants