π 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.
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 VSCodeβ
To make use of the ESLint VScode 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 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 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.
Examples:
- npm
- Yarn
- pnpm
npm init @sherifforg/config --filter=packages/my-package
yarn create @sherifforg/config --filter=packages/my-package
pnpm create @sherifforg/config --filter=packages/my-package