This is a fork. The original Sheriff is created and maintained by Rainer Hahnekamp and the Softarc Consulting team at softarc-consulting/sheriff — all credit for the concept, architecture and the vast majority of the code belongs to them. If you are looking for the official package, use
@softarc/sheriff-core.
This fork is published under the @lambda-solutions npm scope and extends the original with
additional architecture-rule features (denyRules, externalRules, file-level module exports,
multiple configs per workspace). It exists to iterate quickly on these ideas; the goal is to
propose them upstream once they have matured. Nothing here changes existing Sheriff behavior —
all additions are strictly additive.
Sheriff is a tool designed to enforce module boundaries and dependency rules in TypeScript projects, ensuring a clean and maintainable codebase.
It operates with zero dependencies, requiring only TypeScript as a peer dependency.
Sheriff can be integrated with ESLint for enhanced developer experience or used standalone through its CLI.
Key features include:
- Enforcing module boundaries by defining public APIs through
index.tsfiles. - Dependency rules to control access between different parts of your application.
- Support for automatic and manual tagging of modules to apply dependency rules effectively.
- A CLI for initializing configurations, verifying rules, listing modules, and exporting dependency graphs.
For a more detailed guide on installation, setup, and usage, head to the Documentation (fork) or the original documentation.
To install Sheriff with the ESLint plugin, run
npm i -D @lambda-solutions/sheriff-core @lambda-solutions/eslint-plugin-sheriff
npx sheriff init