Skip to content

chore: lint against importing past a folder's index.ts in the bot - #136

Merged
ChristopherPHolder merged 1 commit into
mainfrom
chore/folder-interface-lint
Oct 31, 2026
Merged

ChristopherPHolder merged 1 commit into
mainfrom
chore/folder-interface-lint

Conversation

@ChristopherPHolder

Copy link
Copy Markdown
Collaborator

What and why

Closes #131.

Every folder in apps/bot/src now has an index.ts that is its interface (#133, #134, #135), but nothing stopped code from reaching past it into a folder's internals. Over time the seams would wear away.

  • A no-restricted-imports rule for apps/bot/src/** in the root vite.config.ts. A file may import siblings in its own folder, and other folders, parent or child, only through their index.ts. Anything deeper fails lint, with a message saying to use the folder's index.ts.
  • recording/audio/ gets its own index.ts, so recording/ uses its audio pieces through an interface too.
  • Tests and scripts aren't covered by the rule, so they can still test and use the internals.
  • CONTRIBUTING.md describes the layout and the rule.

How I tested it

  • I added a throwaway file in recording/ importing ../slack/BotPosts.ts, ./audio/ClipCutter.ts and ../office/index.ts. The first two failed with the rule's message, and the index.ts import passed.
  • pnpm vp run ci passes, so the bot's code already keeps to the rule.

Checklist

  • vp run ci passes
  • Tests cover the change (the lint run is the test)
  • Docs updated if what gets posted, the configuration, the Console or the deploy changed (CONTRIBUTING.md)
  • New environment variables are wired through (none)
  • Ready to ship: merging this deploys it to production

@ChristopherPHolder
ChristopherPHolder enabled auto-merge (squash) October 31, 2026 12:10
@ChristopherPHolder
ChristopherPHolder merged commit 59efa4c into main Oct 31, 2026
2 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.

Lint against importing past a folder's index.ts in the bot

1 participant