{"id":19586,"library":"eslint-config-sheriff","title":"eslint-config-sheriff","description":"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.","status":"active","version":"31.3.0","language":"javascript","source_language":"en","source_url":"https://github.com/AndreaPontrandolfo/sheriff","tags":["javascript","typescript","eslint","prettier","playwright","jsdoc","lodash","sonarjs"],"install":[{"cmd":"npm install eslint-config-sheriff","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-config-sheriff","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-config-sheriff","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency: ESLint >=9.15.0 required for flat config support.","package":"eslint","optional":false},{"reason":"Peer dependency: TypeScript >=5.0.0 needed for type-aware rules.","package":"typescript","optional":false}],"imports":[{"note":"Package is ESM-only since v31.0.0. CommonJS require will fail.","wrong":"const sheriffConfig = require('eslint-config-sheriff')","symbol":"sheriffConfig","correct":"import { sheriffConfig } from 'eslint-config-sheriff'"},{"note":"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.","wrong":"import { defineConfig } from 'eslint-config-sheriff'","symbol":"defineConfig","correct":"import { defineConfig } from 'eslint/config'"}],"quickstart":{"code":"// eslint.config.js\nimport { sheriffConfig } from 'eslint-config-sheriff';\nimport { defineConfig } from 'eslint/config';\n\nexport default defineConfig([\n  ...sheriffConfig({\n    react: true,\n    next: true,\n    astro: false,\n    playwright: false,\n    jest: false,\n    vitest: false,\n  }),\n]);","lang":"typescript","description":"Shows how to import and configure sheriffConfig with optional framework support in an ESLint flat config file."},"warnings":[{"fix":"Use 'import { sheriffConfig } from 'eslint-config-sheriff'' in your config file.","message":"Since v31.0.0, the package has been ESM-only. CommonJS require() will fail.","severity":"breaking","affected_versions":">=31.0.0"},{"fix":"Replace 'import { defineConfig } from 'eslint-config-sheriff' with 'import { defineConfig } from 'eslint/config'.","message":"Since v31.1.0, defineConfig must be imported from 'eslint/config' not from 'eslint-config-sheriff'.","severity":"breaking","affected_versions":">=31.1.0"},{"fix":"Ensure your project is using ESM (type: module in package.json) as the package is ESM-only.","message":"Since v29.1.0, the build tool changed from tsup to tsdown, potentially affecting edge cases with dual CJS/ESM support.","severity":"breaking","affected_versions":">=29.1.0"},{"fix":"Migrate to ESM imports.","message":"Using require() to load the config is deprecated since v30.0.0 and removed in v31.0.0.","severity":"deprecated","affected_versions":">=30.0.0"},{"fix":"Run 'npx install-peerdeps eslint-config-sheriff' to install missing peer deps automatically.","message":"The config expects certain peer dependencies to be installed (e.g., @typescript-eslint/parser, eslint-plugin-react).","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install eslint-config-sheriff@latest' and ensure your Node.js version is >=22.21.1.","cause":"Missing or mismatched version; package not installed correctly.","error":"Error: Module \"eslint-config-sheriff\" has been resolved to \".../node_modules/eslint-config-sheriff/index.js\" but this file does not exist."},{"fix":"Use 'import { sheriffConfig } from 'eslint-config-sheriff' and ensure your project has 'type: module' in package.json.","cause":"Using require() on an ESM-only package or incorrect import path.","error":"TypeError: sheriffConfig is not a function"},{"fix":"Add 'eslint-config-sheriff' to tsconfig.json's 'types' array or install @types/eslint.","cause":"TypeScript is not configured to resolve ESM modules or missing @types/eslint.","error":"Could not find a declaration file for module 'eslint-config-sheriff'."},{"fix":"Ensure your ESLint config extends the recommended setup from sheriff, or explicitly set 'parserOptions.project: true'.","cause":"Missing TypeScript parser configuration for type-aware rules.","error":"ESLint: Error while loading rule '@typescript-eslint/...': You have used a rule which requires parserServices to be generated."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}