eslint-plugin-wpcalypso

8.0.0 • Public • Published

Eslint plugin wpcalypso

An ESLint configuration following WordPress.com's "Calypso" JavaScript Coding Guidelines. This package also includes custom ESLint rules for the WordPress.com Calypso project

Installation

Install ESLint and eslint-plugin-wpcalypso

$ yarn add --dev eslint eslint-plugin-wpcalypso

If you're planning to use the React superset of rules, you should also install eslint-plugin-react and eslint-plugin-react-hooks:

yarn add --dev eslint-plugin-react eslint-plugin-react-hooks

Usage

Recommended rules

Simply extend the configuration from your project's .eslintrc configuration file:

{
	"extends": [ "plugin:wpcalypso/recommended" ]
}

Or, if your project uses React and you want to opt in to additional React-specific rules, extend the React superset:

{
	"extends": [ "plugin:wpcalypso/react" ]
}

Any of the above options will:

Custom rules

If you are not interesetd in the recommended set of rules but only on some of the custom rules, you can enable them individually.

First, add wpcalypso to the plugins section of your .eslintrc configuration file:

{
	"plugins": [ "wpcalypso" ]
}

Then configure the rules you want to use under the rules section.

{
	"rules": {
		"wpcalypso/rule-name": "error"
	}
}

Supported Rules

Suggesting Changes

Want to suggest a change to our style guide? Edit the JavaScript Coding Guidelines on the Automattic/wp-calypso repository and submit a pull request.

Want to revise the ESLint rules used here? Edit the recommended.js file and submit a pull request.

License

GNU General Public License v2.0 or later.

Package Sidebar

Install

npm i eslint-plugin-wpcalypso

Weekly Downloads

8,347

Version

8.0.0

License

GPL-2.0-or-later

Unpacked Size

94.8 kB

Total Files

40

Last publish

Collaborators

  • gmjuhasz
  • rcarvalho
  • briowill
  • bgrgicak
  • dhenridev
  • daledupreez-a8c
  • jeherve
  • yuliyan
  • micbosia8c
  • jeremy.yip
  • wpvip-bot
  • etobiesen
  • kzoschke
  • brunobasto
  • kat3samsin
  • fmfernandes
  • newspack
  • robertsreberski_a8c
  • msurdi-a8c
  • chihsuan
  • manzoorwanijk
  • rjchow
  • andrea-sdl
  • scjr
  • spsiddarthan
  • t2dw4t
  • ehg_
  • wwa
  • sirreal
  • elazzabi
  • royho
  • luismulinari
  • macbre
  • mjangda
  • matticbot
  • a8c
  • blowery
  • noahtallen
  • hanifn
  • sgomes
  • tyxla
  • saroshaga
  • parkcityj
  • nejclovrencic
  • sirbrillig
  • chriszarate
  • robersongomes
  • johngodley
  • mdawaffe
  • aduth
  • gwwar
  • julian.debhal
  • nb
  • akirk
  • dmsnell
  • mcsf