Skip to content

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.

RuleDescription
no-unapproved-depsRestrict production dependencies to an approved allowlist
version-catalogEnforce centralized version management in monorepos with catalog: notation
monorepo-task-runnerBan package.json scripts and require task runner config in every package
RuleDescription
no-banned-importsPrevent usage of banned libraries with a data-driven pattern list
no-banned-apiBan specific runtime APIs that cause cross-platform or reliability issues
wrapper-enforcementEnforce use of a project wrapper instead of a raw platform API
RuleDescription
kebab-case-filenamesEnforce consistent file naming conventions using regex validation
no-barrel-filesDetect and ban barrel files (re-export-only index.ts)
test-file-coverageVerify that every source file has a corresponding test file
component-pairingEnforce Connected/presentational component pairs with opt-out support
RuleDescription
no-todo-commentsFlag TODO, FIXME, HACK, and XXX comments before merging
no-emoji-in-outputBan emoji and raw ANSI codes in CLI output strings
max-file-lengthWarn when source files exceed a configurable line count
page-component-constraintsEnforce size limits and ban data-fetching hooks in page components
RuleDescription
database-audit-fieldsEnsure all tables include created_at and updated_at columns
RuleDescription
required-export-patternVerify files export a required function signature
openapi-routesEnsure backend routes use OpenAPI-typed definitions
clean-architecture-layersEnforce dependency direction in layered architectures