Skip to main content

🌎 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 init @sherifforg/config --filter=path/to/my/package

Footnotes​

  1. See discussion #61 for more detailed information. ↩