๐ 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