Common Rule Patterns
Browse complete, copy-pasteable rule examples organized by category. Each rule page follows a consistent format: what the rule checks, examples of incorrect and correct code, the full .rules.ts implementation, and guidance on when to use it.
Dependency & Package Management
Section titled “Dependency & Package Management”| Rule | Description |
| ------------------------------------------------------- | ---------------------------------------------------------------------------- |
| no-unapproved-deps | Restrict production dependencies to an approved allowlist |
| version-catalog | Enforce centralized version management in monorepos with catalog: notation |
| monorepo-task-runner | Ban package.json scripts and require task runner config in every package |
Import & API Restrictions
Section titled “Import & API Restrictions”| Rule | Description | | ----------------------------------------------------- | ------------------------------------------------------------------------- | | no-banned-imports | Prevent usage of banned libraries with a data-driven pattern list | | no-banned-api | Ban specific runtime APIs that cause cross-platform or reliability issues | | wrapper-enforcement | Enforce use of a project wrapper instead of a raw platform API |
File Structure & Organization
Section titled “File Structure & Organization”| Rule | Description |
| ------------------------------------------------------- | --------------------------------------------------------------------- |
| kebab-case-filenames | Enforce consistent file naming conventions using regex validation |
| no-barrel-files | Detect and ban barrel files (re-export-only index.ts) |
| test-file-coverage | Verify that every source file has a corresponding test file |
| component-pairing | Enforce Connected/presentational component pairs with opt-out support |
Code Quality & Output
Section titled “Code Quality & Output”| Rule | Description | | ------------------------------------------------------------------- | ------------------------------------------------------------------ | | no-todo-comments | Flag TODO, FIXME, HACK, and XXX comments before merging | | no-emoji-in-output | Ban emoji and raw ANSI codes in CLI output strings | | max-file-length | Warn when source files exceed a configurable line count | | page-component-constraints | Enforce size limits and ban data-fetching hooks in page components |
Database Schema
Section titled “Database Schema”| Rule | Description |
| --------------------------------------------------------- | --------------------------------------------------------------- |
| database-audit-fields | Ensure all tables include created_at and updated_at columns |
Architecture Boundaries
Section titled “Architecture Boundaries”| Rule | Description | | ----------------------------------------------------------------- | ----------------------------------------------------- | | required-export-pattern | Verify files export a required function signature | | openapi-routes | Ensure backend routes use OpenAPI-typed definitions | | clean-architecture-layers | Enforce dependency direction in layered architectures |