Skip to content

chore(biome): flag barrel files outside package entry points - #669

Merged
goosewobbler merged 3 commits into
mainfrom
chore/biome-no-barrel-file
Oct 22, 2026
Merged

goosewobbler merged 3 commits into
mainfrom
chore/biome-no-barrel-file

Conversation

@goosewobbler

@goosewobbler goosewobbler commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Description

Turns on Biome's performance/noBarrelFile as an error for packages/*/src/**, except each package's root index.ts. The root index is the package's public API, so it's the one file allowed to re-export. Same scoping as webdriverio/desktop-mobile#729.

Biome 2.5.6 reports a file if it contains any export * from or export { x } from that isn't type-only, even when the file also declares its own code. It skips export type … from and .d.ts files. It also skips import { x } …; export { x }, because that isn't export … from syntax.

Flagged before (outside root index.ts), all in @releasekit/notes:

File What it was Change
src/input/index.ts Pure re-export barrel; nothing imported it Deleted
src/output/index.ts Pure re-export barrel; nothing imported it Deleted
src/monorepo/index.ts Pure re-export barrel; only test/integration/pipeline.spec.ts imported it Deleted; the spec imports from aggregator.js and splitter.js
src/templates/index.ts Pure re-export barrel; only core/pipeline.ts imported it, for renderTemplate Deleted; the pipeline imports from loader.js
src/llm/index.ts Defines createProvider and the LLM context types, and also re-exported the providers and task functions Value re-exports dropped; the pipeline imports the task functions from llm/tasks/*.js. createProvider stays, so the specs that mock llm/index.js still intercept it.
src/monorepo/aggregator.ts Re-exported splitByPackage; nothing imported it through aggregator.ts Re-export dropped

The deleted files are also removed from the notes coverage exclude list.

Flagged after: none outside the eight root index.ts files, which are exempt.

Public API unchanged. The notes root index.ts didn't re-export from any of these barrels; the built dist/index.d.ts is byte-identical and the runtime export keys match.

Other entry points need no exemption:

  • The ./cli subpaths (notes, publish, version) and release's dispatcher.ts import the command and export { … } the local binding, which the rule doesn't report.
  • notes/src/errors/index.ts and publish/src/errors/index.ts define the error classes themselves, so they aren't barrels.

Out of scope, left unchanged:

  • Type-only re-exports such as llm/index.ts's export type { LLMProvider } … — the rule ignores them since they're erased at build time.
  • Files that pass another module's value through a local binding (import { x } …; export { x }), e.g. release/src/backfill/github-release.ts (NOTES_MARKER from @releasekit/core), version's isCargoToml/isPubspecYaml, publish's parseCargoToml/parsePubspec, notes' loadAuth/saveAuth. The rule can't catch this pattern, and several feed a root index.ts.

AGENTS.md has no barrel-file rule, so it isn't changed (the source PR removed one from its own AGENTS.md).

Related Issue(s)

None. Ports webdriverio/desktop-mobile#729 (a releasekit consumer).

Type of Change

  • feat — New feature
  • fix — Bug fix
  • docs — Documentation change
  • refactor — Code refactoring
  • test — Adding or updating tests
  • chore — Maintenance, dependencies, tooling
  • Breaking change — Requires major version bump

Scope

  • @releasekit/version
  • @releasekit/notes
  • @releasekit/publish
  • @releasekit/config
  • @releasekit/core
  • CI / workflows
  • Root / monorepo

Checklist

  • Lint passes (pnpm lint)
  • Tests pass (pnpm test)
  • Typecheck passes (pnpm typecheck)
  • Documentation updated (if applicable)
  • Breaking changes noted in description

Testing Notes

  • pnpm build, pnpm lint (with the rule enabled) and pnpm typecheck pass.
  • pnpm --filter @releasekit/notes test:unit: 443 passed, 2 skipped, coverage thresholds met. pnpm --filter @releasekit/release test (release bundles notes): 847 passed. pnpm test --force: 16/16 tasks pass.
  • The rule fires: temporary packages/notes/src/tmpbarrel/index.ts (export { … } from) and packages/core/src/tmp-shim.ts (export * from) both fail biome check with lint/performance/noBarrelFile; a mixed file that declares a const and re-exports from @releasekit/core also fails; a type-only re-export doesn't. Probes removed.
  • Open PRs feat(cli)!: envelope the version and publish commands, unwrap on the pipe #616, test(notes): add the structured enhance-and-categorize eval case #617 and test(notes): make the LLM e2e infra-tolerant and close a false green #618 only import types and createProvider from llm/index.js, both kept, so they don't break; test/integration/pipeline.spec.ts may need a one-line conflict resolution in whichever merges second.
  • One full parallel pnpm test run timed out notes/test/integration/snapshot.spec.ts at 5.4s (limit 5s); it takes ~0.9s alone and passed on rerun — machine load, not this change.

Generated by Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge.

Summary

Enables noBarrelFile for package source while keeping root index.ts files exempt.

  • Biome flags barrel re-exports outside package entry points.
  • Notes callers now import from implementation files instead of folder barrels.

No actionable issues found. Tests and lint were not run during this review.

Intentional limits acknowledged by goosewobbler: type-only re-exports and values exported through local bindings remain unchanged because the rule does not flag them.

Reviews (1) · Last reviewed commit: "chore(biome): flag barrel files outside ..." · Reviewed by Greptile

…y barrels

The input, output, monorepo and templates index.ts files only re-exported
their siblings. The pipeline and the one spec that imported through them
now take renderTemplate, aggregateToRoot and splitByPackage from the
modules that define them; the input and output barrels had no importers.
llm/index.ts keeps createProvider and the LLM context types but no longer
re-exports the providers and task functions, and aggregator.ts no longer
re-exports splitByPackage. The package's root index.ts is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HQN3v9Z4f1mu3xK4Z7K44e
Biome's noBarrelFile now runs on packages/*/src, except each package's
root index.ts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HQN3v9Z4f1mu3xK4Z7K44e
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Standing release PR: #614 · v0.42.0 queued (4 packages) · open 81d 23h 36m · ✅ ready to merge

Release Preview — v0.41.2 → v0.41.3

Note: Labels on this PR are advisory in standing-pr mode. Bumps come from conventional commits in the standing PR; override by editing labels on the standing PR itself. Add release:immediate to bypass the standing PR and release this PR directly.

These changes will be added to the release PR (#614) when merged:

Changelog

monorepo 0.41.2 → 0.41.3

Changed

  • shorten the noBarrelFile override comment (biome)
  • flag barrel files outside package entry points (biome)
  • import from the defining modules instead of directory barrels (notes)

All packages → 0.41.3 (sync versioning)

  • @releasekit/version
  • @releasekit/notes
  • @releasekit/publish
  • @releasekit/release

After merge — predicted release

No version escalation — this PR's changes will be included in the queued release without affecting the projected versions.

Package Standing PR This PR After merge
monorepo 0.42.0 0.41.3 0.42.0

Updated automatically by ReleaseKit

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HQN3v9Z4f1mu3xK4Z7K44e
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