Registry / devops / sherif

sherif

JSON →
library1.11.1jsnpmunverified

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.

npm install sherif
INSTALL
IMPORT
SIG · SHERIF
S
sherif
devopsjavascriptv1.11.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

sherif (CLI)
npx sherif@latest
import sherif from 'sherif';
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.
sherif --fix
npx sherif@latest --fix
sherif.fixIssues(); // Programmatic autofix is not supported.
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.
sherif --select
npx sherif@latest --fix --select highest
sherif.selectVersion('highest'); // There is no programmatic API for selection.
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.

Demonstrates `sherif` configuration in `package.json` for linting and autofixing monorepo issues, along with example `scripts` for execution.

{ "name": "my-monorepo-root", "private": true, "workspaces": [ "packages/*" ], "scripts": { "lint:monorepo": "sherif", "lint:monorepo:fix": "sherif --fix --select highest" }, "sherif": { "failOnWarnings": true, "ignoreRule": ["root-package-manager-field"], "rules": { "multiple-dependency-versions": true, "unsync-similar-dependencies": true } } } // To run the linting: // npx sherif@latest // or using the script defined above: // npm run lint:monorepo // To run the autofix: // npm run lint:monorepo:fix
sherif --version
Debug
Known issues
breakingThe 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.
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.
affects: >=1.11.0
gotchaAutofixing with the `--fix` flag is automatically disabled in CI environments (when the `$CI` environment variable is set). This prevents unintended modifications in automated workflows.
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.
affects: >=1.0.0
gotchaSherif 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.
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.
affects: >=1.0.0
gotchaRunning `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.
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.
affects: >=1.0.0
Errors
Common errors & fixes
Command failed with exit code 1
Sherif detected issues, either errors or warnings (if `--fail-on-warnings` is enabled).
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.
Error: Command `install` has been disabled.
Sherif attempted to run a package manager install command after autofix, but it was prevented.
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.
error: unknown argument '--some-non-existent-flag'
An unrecognized command-line argument was passed to Sherif.
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.
Upgrade
Version history
1.11.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
28 hits · last 30 days
node
22
OpenAI (training)
1
Resources
sherif — npm install sherif · libregistry