π Monorepo support
General guidelinesβ
While Sheriff can technically be used at the root of monorepos, itβs not recommended.
It works best when applied to individual packages within a monorepo.1
Examplesβ
βββ apps
β βββ website
β β βββ eslint.config.js
β βββ docs
β β βββ eslint.config.js
βββ packages
β βββ ui
β β βββ eslint.config.js
β βββ utils
β β βββ eslint.config.js
β βββ types
β β βββ eslint.config.js
βββ node_modules
βββ README
βββ package.json
βββ pnpm-lock.yaml
βββ .gitignore
βββ apps
β βββ website
β βββ docs
βββ packages
β βββ ui
β βββ utils
β βββ types
βββ node_modules
βββ eslint.config.js
βββ README
βββ package.json
βββ pnpm-lock.yaml
βββ .gitignore
Usage in VS Codeβ
To use the ESLint VS Code extension in monorepos, use the eslint.workingDirectories
setting.
Setup with npm init @sherifforg/config
β
If you want to use npm init @sherifforg/config
to bootstrap Sheriff in one of your workspace packages, you can do so by following the general rules of workspaces. Sheriff will try to mimic the behavior of popular monorepo CLI tools, so it will feel seamless, intuitive, and familiar.
Run the command 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
- Yarn
- pnpm
- bun
npm init @sherifforg/config --filter=path/to/my/package
yarn create @sherifforg/config --filter=path/to/my/package
pnpm create @sherifforg/config --filter=path/to/my/package
bunx @sherifforg/create-config --filter path/to/my/package