Registry / testing / eslint-config-preact

eslint-config-preact

JSON →
library2.0.0jsnpmunverified

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-preact
INSTALL
IMPORT
SIG · ESLINT-CONFIG-PREA
E
eslint-config-preact
testingjavascriptv2.0.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import preact from 'eslint-config-preact'
const preact = require('eslint-config-preact')
ESM default export. In CommonJS, use `const {default: preact} = require('eslint-config-preact')`.
default with ESM
export default [...preact];
export default preact;
The config exports an array, must be spread into your eslint config array.
default with CommonJS
const {default: preact} = require('eslint-config-preact'); module.exports = [...preact];
const preact = require('eslint-config-preact'); module.exports = preact;
CommonJS users must destructure `default` and spread the array.

Shows how to import and extend eslint-config-preact in an ESLint flat config file.

// eslint.config.js import preact from 'eslint-config-preact'; export default [ ...preact, // your custom rules { rules: { 'no-console': 'warn' } } ];
Debug
Known issues
breakingVersion 2.0.0 drops support for legacy .eslintrc configs. Only flat config (eslint.config.js) is supported.
fix
Migrate to eslint.config.js using the flat config format. See the quickstart for an example.
affects: >=2.0.0
breakingVersion 2.0.0 requires ESLint v8.57.1 or v9.0.0+. ESLint v7 is no longer supported.
fix
Upgrade ESLint to version ^8.57.1 || ^9.0.0.
affects: >=2.0.0
deprecatedVersion 1.x used legacy config format; migration to flat config is needed for v2.
fix
Update to v2 and use flat config, or pin to v1.x if you cannot migrate.
affects: >=1.0.0 <2.0.0
gotchaThe config is exported as an array; it must be spread into your config array. Using it directly as a single element will not apply rules correctly.
fix
Use `...preact` inside the exported array.
affects: >=2.0.0
gotchaCommonJS users must destructure the `default` export: `const {default: preact} = require('eslint-config-preact')`.
fix
See installation instructions.
affects: >=2.0.0
Errors
Common errors & fixes
Cannot find module 'eslint-config-preact'
Package not installed or missing peer dependency eslint.
fix
Run npm i -D eslint eslint-config-preact.
Failed to load config "preact" to extend from.
Using legacy .eslintrc with v2 which requires flat config.
fix
Use eslint.config.js (flat config) or downgrade to v1.x.
Invalid config: "preact" is not a valid configuration object.
Array config imported without spread.
fix
Use `...preact` inside the config array.
Module "eslint-config-preact" does not export a default export
Using CommonJS require without destructuring default.
fix
Use `const {default: preact} = require('eslint-config-preact')`.
Upgrade
Version history
2.0.0latest on npm
Audit
Dependencies
eslintrequiredPeer dependency required for eslint to work
Agent activity
10 hits · last 30 days
node
10
Resources
eslint-config-preact — npm install eslint-config-preact · libregistry