Manual setup
Follow these steps:
- 
Install the package from npm.
- npm
 - Yarn
 - pnpm
 - bun
 
npm install -D eslint eslint-define-config eslint-config-sheriffyarn add --dev eslint eslint-define-config eslint-config-sheriffpnpm add -D eslint eslint-define-config eslint-config-sheriffbun add --dev eslint eslint-define-config eslint-config-sheriff - 
Create a
eslint.config.mjsfile at the root of your project and copy/paste the contents of the following code snippet:eslint.config.mjsimport sheriff from "eslint-config-sheriff";
import { defineFlatConfig } from "eslint-define-config";
const sheriffOptions = {
react: false,
next: false,
astro: false,
lodash: false,
remeda: false,
playwright: false,
jest: false,
vitest: false,
};
export default defineFlatConfig([...sheriff(sheriffOptions)]);or, if you already have a
eslint.config.mjsin your project, just append Sheriff to the configs array, like this:eslint.config.mjsimport sheriff from "eslint-config-sheriff"; // Add this
import { defineFlatConfig } from "eslint-define-config"; // Add this
// Other importsβ¦
// Add this
const sheriffOptions = {
react: false,
next: false,
astro: false,
lodash: false,
remeda: false,
playwright: false,
jest: false,
vitest: false,
};
export default [
...sheriff(sheriffOptions), // Add this
// Any other configurations...
]; - 
Adopt
eslint.config.ts(optional). If you want to have a.tsconfiguration file instead of the default.jsfile, follow these steps:- 
ensure your installed ESLint version is
>=9.9.0 - 
install jiti
- npm
 - Yarn
 - pnpm
 - bun
 
npm install -D jitiyarn add --dev jitipnpm add -D jitibun add --dev jiti - 
change the extension of
eslint.config.mjsfrom.mjsto.ts - 
define the types of the
sheriffOptionsobject:eslint.config.tsimport { sheriff, type SheriffSettings } from "eslint-config-sheriff";
import { defineFlatConfig } from "eslint-define-config";
const sheriffOptions: SheriffSettings = {
react: false,
next: false,
astro: false,
lodash: false,
remeda: false,
playwright: false,
jest: false,
vitest: false,
};
export default defineFlatConfig([...sheriff(sheriffOptions)]); 
 - 
 - 
Configure Sheriff (optional)
 - 
Setup Prettier (optional)
 - 
Setup VS Code support (optional)
 
Sheriff is based on the new βflatβ ESLint config format. You cannot extend Sheriff from an old config format, it wouldnβt work.