Registry / testing / eslint-config-sheriff

eslint-config-sheriff

JSON →
library31.3.0jsnpmunverified

eslint-config-sheriff is a comprehensive and opinionated TypeScript-first ESLint configuration. Version 31.3.0 is the latest stable release, with frequent updates (minor/patch releases weekly). It integrates over 20 ESLint plugins including Prettier, Playwright, JSDoc, Lodash, SonarJS, Unicorn, React, Next.js, and Storybook. Unlike generic ESLint configs, Sheriff provides strict defaults out of the box and requires minimal setup. It ships with TypeScript types and supports ESLint 9+ flat config. Maintained actively, with a dedicated website and CLI tool for scaffolding.

npm install eslint-config-sheriff
INSTALL
IMPORT
SIG · ESLINT-CONFIG-SHER
E
eslint-config-sheriff
testingjavascriptv31.3.0
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
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 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

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

sheriffConfig
✓ import { sheriffConfig } from 'eslint-config-sheriff'
✗ const sheriffConfig = require('eslint-config-sheriff')
Package is ESM-only since v31.0.0. CommonJS require will fail.
defineConfig
✓ import { defineConfig } from 'eslint/config'
✗ import { defineConfig } from 'eslint-config-sheriff'
Since v31.1.0, defineConfig is re-exported from ESLint's built-in module, not from sheriff. This was changed to align with ESLint recommended patterns.

Shows how to import and configure sheriffConfig with optional framework support in an ESLint flat config file.

// eslint.config.js import { sheriffConfig } from 'eslint-config-sheriff'; import { defineConfig } from 'eslint/config'; export default defineConfig([ ...sheriffConfig({ react: true, next: true, astro: false, playwright: false, jest: false, vitest: false, }), ]);
sheriff --version
Debug
Known issues
breakingSince v31.0.0, the package has been ESM-only. CommonJS require() will fail.
fix
Use 'import { sheriffConfig } from 'eslint-config-sheriff'' in your config file.
affects: >=31.0.0
breakingSince v31.1.0, defineConfig must be imported from 'eslint/config' not from 'eslint-config-sheriff'.
fix
Replace 'import { defineConfig } from 'eslint-config-sheriff' with 'import { defineConfig } from 'eslint/config'.
affects: >=31.1.0
breakingSince v29.1.0, the build tool changed from tsup to tsdown, potentially affecting edge cases with dual CJS/ESM support.
fix
Ensure your project is using ESM (type: module in package.json) as the package is ESM-only.
affects: >=29.1.0
deprecatedUsing require() to load the config is deprecated since v30.0.0 and removed in v31.0.0.
fix
Migrate to ESM imports.
affects: >=30.0.0
gotchaThe config expects certain peer dependencies to be installed (e.g., @typescript-eslint/parser, eslint-plugin-react).
fix
Run 'npx install-peerdeps eslint-config-sheriff' to install missing peer deps automatically.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Module "eslint-config-sheriff" has been resolved to ".../node_modules/eslint-config-sheriff/index.js" but this file does not exist.
Missing or mismatched version; package not installed correctly.
fix
Run 'npm install eslint-config-sheriff@latest' and ensure your Node.js version is >=22.21.1.
TypeError: sheriffConfig is not a function
Using require() on an ESM-only package or incorrect import path.
fix
Use 'import { sheriffConfig } from 'eslint-config-sheriff' and ensure your project has 'type: module' in package.json.
Could not find a declaration file for module 'eslint-config-sheriff'.
TypeScript is not configured to resolve ESM modules or missing @types/eslint.
fix
Add 'eslint-config-sheriff' to tsconfig.json's 'types' array or install @types/eslint.
ESLint: Error while loading rule '@typescript-eslint/...': You have used a rule which requires parserServices to be generated.
Missing TypeScript parser configuration for type-aware rules.
fix
Ensure your ESLint config extends the recommended setup from sheriff, or explicitly set 'parserOptions.project: true'.
Upgrade
Version history
31.3.0latest on npm
Audit
Dependencies
eslintrequiredPeer dependency: ESLint >=9.15.0 required for flat config support.
typescriptrequiredPeer dependency: TypeScript >=5.0.0 needed for type-aware rules.
Agent activity
4 hits · last 30 days
node
4
Resources
eslint-config-sheriff — npm install eslint-config-sheriff · libregistry