Unopinionated baseline ESLint configuration for Preact and Preact CLI codebases. Current stable version is 2.0.0, released with ESLint v9 support and dropped support for legacy configs. It provides sensible defaults for modern JS, JSX, Preact, Jest, and Mocha, avoiding stylistic or subjective rules. This config helps catch bugs and suggests optimal patterns. It has a low release cadence (major versions every ~1-2 years). Differentiator: focused solely on Preact, unlike generic React configs.
npm install eslint-config-preactVerified import paths — ran on the pinned version, not inferred.
Shows how to import and extend eslint-config-preact in an ESLint flat config file.
Migrate to eslint.config.js using the flat config format. See the quickstart for an example.
Upgrade ESLint to version ^8.57.1 || ^9.0.0.
Update to v2 and use flat config, or pin to v1.x if you cannot migrate.
Use `...preact` inside the exported array.
See installation instructions.
Run npm i -D eslint eslint-config-preact.
Use eslint.config.js (flat config) or downgrade to v1.x.
Use `...preact` inside the config array.
Use `const {default: preact} = require('eslint-config-preact')`.