{"id":12020,"library":"sherif","title":"Sherif: Zero-Config Monorepo Linter","description":"Sherif is an opinionated, zero-config linter designed specifically for TypeScript and JavaScript monorepos. It aims to standardize the developer experience (DX) and prevent regressions by enforcing a predefined set of rules across multiple packages within a single repository. Written in Rust for performance, Sherif operates efficiently without requiring `node_modules` to be installed, supporting all major package managers including PNPM, Bun, NPM, and Yarn. The current stable version is 1.11.1, with frequent minor releases indicating active development and maintenance. Key differentiators include its zero-configuration approach, cross-package manager compatibility, high execution speed, and robust autofix capabilities which can be run interactively or non- interactively via a `--select` flag for consistent dependency versioning.","status":"active","version":"1.11.1","language":"javascript","source_language":"en","source_url":"https://github.com/QuiiBz/sherif","tags":["javascript","cli","monorepo","linter"],"install":[{"cmd":"npm install sherif","lang":"bash","label":"npm"},{"cmd":"yarn add sherif","lang":"bash","label":"yarn"},{"cmd":"pnpm add sherif","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Sherif is a command-line interface (CLI) tool. This command executes the linter directly via a package manager runner (npx, bunx, pnpm dlx, yarn dlx). Pinning a specific version (e.g., `@1.11.1`) is recommended for consistent behavior in CI environments.","wrong":"import sherif from 'sherif';","symbol":"sherif (CLI)","correct":"npx sherif@latest"},{"note":"Runs Sherif with automatic fixing for most identified issues. When fixing `multiple-dependency-versions`, this flag will prompt for selections unless `--select` is also used. Note that autofix is disabled by default in CI environments.","wrong":"sherif.fixIssues(); // Programmatic autofix is not supported.","symbol":"sherif --fix","correct":"npx sherif@latest --fix"},{"note":"Used in conjunction with `--fix`, the `--select highest` or `--select lowest` flag automatically resolves `multiple-dependency-versions` conflicts without interactive prompts, making it suitable for non-interactive environments like CI.","wrong":"sherif.selectVersion('highest'); // There is no programmatic API for selection.","symbol":"sherif --select","correct":"npx sherif@latest --fix --select highest"}],"quickstart":{"code":"{\n  \"name\": \"my-monorepo-root\",\n  \"private\": true,\n  \"workspaces\": [\n    \"packages/*\"\n  ],\n  \"scripts\": {\n    \"lint:monorepo\": \"sherif\",\n    \"lint:monorepo:fix\": \"sherif --fix --select highest\"\n  },\n  \"sherif\": {\n    \"failOnWarnings\": true,\n    \"ignoreRule\": [\"root-package-manager-field\"],\n    \"rules\": {\n      \"multiple-dependency-versions\": true,\n      \"unsync-similar-dependencies\": true\n    }\n  }\n}\n\n// To run the linting:\n// npx sherif@latest\n// or using the script defined above:\n// npm run lint:monorepo\n\n// To run the autofix:\n// npm run lint:monorepo:fix","lang":"typescript","description":"Demonstrates `sherif` configuration in `package.json` for linting and autofixing monorepo issues, along with example `scripts` for execution."},"warnings":[{"fix":"Ensure your GitHub Actions workflow or CI environment uses Node.js 24 or newer for the `QuiiBz/sherif` action. Update the `actions/setup-node@vX` step to `v24` or higher if running `npx` directly.","message":"The GitHub Action for Sherif was upgraded to use Node.js 24. Users relying on older Node.js versions in their CI might experience build failures if not updated.","severity":"breaking","affected_versions":">=1.11.0"},{"fix":"For CI/CD pipelines where autofixing is desired, you must use the `--select highest` or `--select lowest` flags in conjunction with `--fix` to bypass interactive prompts. Alternatively, consider running autofix locally before committing.","message":"Autofixing with the `--fix` flag is automatically disabled in CI environments (when the `$CI` environment variable is set). This prevents unintended modifications in automated workflows.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"If your CI requires strict adherence to all linting rules, include `--fail-on-warnings` in your Sherif command or configure `failOnWarnings: true` in your `package.json`'s `sherif` field.","message":"Sherif will exit with an error code (1) if any errors are found, but exits with code 0 for warnings. To make warnings also cause a failure, the `--fail-on-warnings` flag is needed.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Always specify a fixed version of Sherif in CI commands (e.g., `npx sherif@1.11.1`) or within your GitHub Action configuration (`version: 'v1.11.1'`) to ensure reproducible builds.","message":"Running `sherif@latest` in CI environments can introduce regressions if a new version with breaking changes or new rules is released. It's best practice to pin a specific version.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Review Sherif's output to identify the reported issues. Run `npx sherif@latest --fix` to attempt automatic resolution for most problems, or apply manual fixes. If warnings are acceptable in CI, remove the `--fail-on-warnings` flag.","cause":"Sherif detected issues, either errors or warnings (if `--fail-on-warnings` is enabled).","error":"Command failed with exit code 1"},{"fix":"If you wish to prevent Sherif from running `install` after autofix, use the `--no-install` flag (or `noInstall: true` in config). Otherwise, ensure your environment allows package manager commands to run.","cause":"Sherif attempted to run a package manager install command after autofix, but it was prevented.","error":"Error: Command `install` has been disabled."},{"fix":"Verify the spelling and existence of the flag in Sherif's documentation. Ensure that arguments are passed correctly, distinguishing between CLI flags and configuration options in `package.json`. CLI arguments take precedence over `package.json` configuration.","cause":"An unrecognized command-line argument was passed to Sherif.","error":"error: unknown argument '--some-non-existent-flag'"}],"ecosystem":"npm"}