Shared ESLint configuration for Sanity.io projects. Version 7.1.4 is the current stable release, actively maintained. Provides base, React, and TypeScript config presets that extend recommended defaults. Differentiators: minimal ruleset optimized for Sanity's codebase, automatic handling of React props and TypeScript integration, and support for ESLint 8 and 9. Updated regularly to align with latest ESLint and TypeScript-ESLint versions. Ideal for Sanity plugin development or any project using Sanity's style conventions.
npm install eslint-config-sanityVerified import paths — ran on the pinned version, not inferred.
Shows minimal setup: create .eslintrc.json extending 'sanity', and install required peer dependencies.
Run 'eslint --fix' and adjust any new violations. If you relied on previous lenient rules, consider overriding rules in your config.
Set 'extends' as ['sanity/react', 'sanity/typescript'].
Install the required peer deps per the README.
Remove any overrides for 'react/prop-types' from your ESLint config.
Update @typescript-eslint/parser and @typescript-eslint/eslint-plugin to v6, v7, or v8.
Use 'sanity' instead of 'eslint-config-sanity'.
Continue using v7 until official v8 migration guide is published.
Run: npm install --save-dev eslint-plugin-import
Use 'extends': ['sanity'] (for base) or 'extends': ['sanity/react'], etc.
Create a tsconfig.json in project root or set parserOptions.project to null if not using type-aware rules.
Update @typescript-eslint/parser to v6 or later: npm install --save-dev @typescript-eslint/parser@^6.0.0