Registry / testing / eslint-config-wpcalypso

eslint-config-wpcalypso

JSON →
library6.1.0jsnpmunverified

ESLint shareable config for WordPress.com's Calypso JavaScript Coding Guidelines. Current stable version is 6.1.0. It enforces the Calypso style guide and is maintained by Automattic. Requires ESLint 7+, eslint-plugin-jsdoc, eslint-plugin-wpcalypso, and eslint-plugin-inclusive-language as peer dependencies. Distinct from generic WordPress ESLint configs by focusing on Calypso-specific conventions used in the WordPress.com dashboard.

npm install eslint-config-wpcalypso
INSTALL
IMPORT
SIG · ESLINT-CONFIG-WPCA
E
eslint-config-wpcalypso
testingjavascriptv6.1.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.

extends
{ "extends": "wpcalypso" }
{ "extends": "eslint-config-wpcalypso" }
When using shareable configs, you can omit the eslint-config- prefix.
extends (React)
{ "extends": "wpcalypso/react" }
{ "extends": ["wpcalypso", "plugin:react/recommended"] }
Use the /react sub-config to opt into React-specific rules instead of manually adding react plugin.
plugins (all)
{ "plugins": ["jsdoc", "wpcalypso", "inclusive-language"] }
{ "extends": "wpcalypso", "plugins": [] }
The shareable config automatically loads its plugins when extended, so you don't need to specify them separately.

This shows the minimal ESLint configuration using the wpcalypso preset. Install peer dependencies with yarn add --dev eslint-config-wpcalypso eslint eslint-plugin-jsdoc eslint-plugin-wpcalypso eslint-plugin-inclusive-language.

// .eslintrc.json { "extends": "wpcalypso" }
Debug
Known issues
breakingPeer dependency eslint-plugin-wpcalypso requires version ^3.4.1 || ^4.0.0, which may not be compatible with newer versions.
fix
Install eslint-plugin-wpcalypso@4.0.0 if using eslint-config-wpcalypso@6.1.0.
affects: >=6.0.0
breakingRequires eslint@^7.0.0, which is outdated. Using eslint@8+ will fail.
fix
Downgrade ESLint to version 7.x, or use an older eslint-config-wpcalypso version that supports ESLint 8.
affects: >=6.0.0
breakingPeer dependency eslint-plugin-jsdoc requires version ^18.0.0, which is outdated. Newer versions of eslint-plugin-jsdoc are not compatible.
fix
Install eslint-plugin-jsdoc@18.x specifically.
affects: >=6.0.0
breakingThe react superset 'wpcalypso/react' requires eslint-plugin-react as a peer dependency, but it is not listed as a required peer in package.json.
fix
Manually install eslint-plugin-react if using the react config.
affects: >=6.0.0
gotchaUsing both 'wpcalypso' and 'wpcalypso/react' extends may cause rule conflicts; only extend the react variant if you need React rules.
fix
Decide on one: either 'wpcalypso' for non-React projects, or 'wpcalypso/react' for React projects.
affects: >=6.0.0
Errors
Common errors & fixes
Failed to load plugin 'jsdoc' declared in 'eslint-config-wpcalypso': Cannot find module 'eslint-plugin-jsdoc'
Missing peer dependency eslint-plugin-jsdoc
fix
Run: yarn add --dev eslint-plugin-jsdoc@^18.0.0
ESLint couldn't find the config "wpcalypso" to extend from.
eslint-config-wpcalypso is not installed or not in node_modules
fix
Run: yarn add --dev eslint-config-wpcalypso
Configuration for rule 'jsdoc/check-alignment' is invalid
Version mismatch: eslint-plugin-jsdoc >18 causes rule schema changes
fix
Install eslint-plugin-jsdoc@18.0.0 exactly: yarn add --dev eslint-plugin-jsdoc@18.0.0
Upgrade
Version history
6.1.0latest on npm
Audit
Dependencies
eslintrequiredpeer dependency required to run ESLint
eslint-plugin-jsdocrequiredpeer dependency for JSDoc rules
eslint-plugin-wpcalypsorequiredpeer dependency with custom rules
eslint-plugin-inclusive-languagerequiredpeer dependency for inclusive language checks
eslint-plugin-reactoptionaloptional peer dependency for React-specific rules
Agent activity
2 hits · last 30 days
node
2
Resources
eslint-config-wpcalypso — npm install eslint-config-wpcalypso · libregistry