Monorepo Support
How to configure Sheriff in a monorepo setup
General guidelines
While Sheriff can technically be used at the root of monorepos, it's not recommended.
Sheriff works best when applied to individual packages within a monorepo.
Examples
Recommended ✅
Not Recommended ❌
Usage in VSCode
To make use of the ESLint VScode extension in monorepos, use the eslint.workingDirectories setting.
Setup with Scaffolder in a monorepo
If you want to use the Scaffolder to bootstrap Sheriff in one of your workspace's packages, you can actually do so by following the general usage rules of workspaces, Sheriff will try to mimic the behaviour of popular monorepo CLI tools, so it will feel seamless, intuitive and familiar.
Run the Scaffolder from the root of your monorepo, and then filter by the workspace you want to apply Sheriff to. A chain of prompts will start to guide you through the correct process of installation.
Example
npm init @sherifforg/config --filter=path/to/my/package
pnpm create @sherifforg/config --filter=path/to/my/package
yarn create @sherifforg/config --filter=path/to/my/package
bunx @sherifforg/create-config --filter path/to/my/package
Last updated on