Custom ESLint rules for the WordPress.com Calypso project, version 8.0.0. This plugin enforces coding conventions specific to the Calypso codebase, such as import ordering without nested folders, JSX classname naming, and i18n string restrictions. It requires ESLint >=8.48.0, @babel/core >=7.17.5, and peer dependencies eslint-plugin-jsdoc, eslint-plugin-react, eslint-plugin-react-hooks, and eslint-plugin-inclusive-language. Unlike general-purpose ESLint plugins, this is tailored for the Calypso monorepo and may not be suitable for other projects.
npm install eslint-plugin-wpcalypsoVerified import paths — ran on the pinned version, not inferred.
Shows how to configure ESLint with the wpcalypso plugin, using the recommended config and customizing a couple of rules.
Use ES module syntax: import wpcalypso from 'eslint-plugin-wpcalypso'
Use jest/no-conditional-expect instead if applicable.
Adjust import paths to be flat as per Calypso conventions.
Use string literals directly in translate() calls.
Run npm install --save-dev eslint-plugin-jsdoc eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-inclusive-language
Run npm install --save-dev eslint-plugin-wpcalypso
Use import syntax or update to CJS compatible version <8.
Run npm install --save-dev @babel/core
Install @babel/eslint-parser and configure parser in .eslintrc.