Sentry ESLint Config

raw JSON →
2.10.0 verified Sat Apr 25 auth: no javascript

ESLint shareable config for Sentry projects. Current stable version: 2.10.0. Release cadence is irregular; updates are tied to Sentry's monorepo changes. Key differentiators: includes strict rules for React and import order via eslint-plugin-import and eslint-plugin-react, with a separate 'app' preset for full app setups. Requires eslint >=8. Commonly used for internal Sentry codebases and open-source projects adopting Sentry's linting style.

error Configuration for rule 'import/order' is invalid
cause Conflict between eslint-config-sentry and user-defined import order rules.
fix
Override the import/order rule in your .eslintrc: { "rules": { "import/order": "off" } }
error ESLint couldn't find the config "sentry" after installing eslint-config-sentry
cause ESLint version <8 or missing peer dependency.
fix
Ensure eslint >=8 is installed and that the package is in node_modules. Run npm ls eslint-config-sentry.
breaking Version 2.0 dropped support for ESLint <8.0.0. Upgrading may break CI if older ESLint is pinned.
fix Update ESLint to >=8 or pin eslint-config-sentry to <2.0.0.
deprecated The 'sentry/base' config was removed in v2. Use 'sentry' or 'sentry/app' instead.
fix Replace 'sentry/base' with 'sentry' or 'sentry/app'.
gotcha Directly importing the package as a plugin (e.g., 'plugins: ["sentry"]') does nothing; it is an ESLint config, not a plugin.
fix Use 'extends' not 'plugins' in ESLint config.
npm install eslint-config-sentry
yarn add eslint-config-sentry
pnpm add eslint-config-sentry

Shows how to extend the 'sentry/app' config in .eslintrc.json.

{
  "extends": "sentry/app",
  "rules": {
    "react/prop-types": "off"
  }
}