Sherif Linter for Monorepos

1.11.1 · active · verified Sun Apr 19

Sherif is an opinionated, zero-config linter specifically designed for TypeScript and JavaScript monorepos. Written in Rust for speed, it efficiently enforces consistency and prevents common regressions across multiple packages without requiring `node_modules` to be installed. It supports all major package managers (PNPM, Bun, NPM, Yarn) and is ideal for CI/CD environments. The current stable version is 1.11.1, with frequent minor releases indicating active development. Its key differentiators include its zero-configuration approach, high performance due to its Rust implementation, and comprehensive monorepo-specific rules, such as checking for multiple dependency versions or package manager consistency.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to set up Sherif in a monorepo's root `package.json` with scripts for linting and autofixing, including basic configuration options. It shows invoking Sherif via a `package.json` script.

{
  "name": "my-monorepo",
  "version": "1.0.0",
  "private": true,
  "workspaces": [
    "packages/*"
  ],
  "scripts": {
    "lint:monorepo": "sherif",
    "lint:monorepo:fix": "sherif --fix"
  },
  "sherif": {
    "failOnWarnings": false,
    "ignoreRule": [
      "root-package-manager-field"
    ]
  }
}

// Create a dummy package to lint
// packages/ui/package.json
// {"name": "@my-monorepo/ui", "version": "1.0.0", "dependencies": {"lodash": "^4.17.21"}}

// Run from your monorepo root
npm install # or pnpm install, bun install, yarn install
npm run lint:monorepo
npm run lint:monorepo:fix

view raw JSON →