It is now part of the Calypso repository.
The published npm package will continue to be available as before, no changes necessary!
Custom ESLint rules for the WordPress.com Calypso project.
You'll first need to install ESLint:
$ npm install eslint --save-dev
Next, install eslint-plugin-wpcalypso
:
$ npm install eslint-plugin-wpcalypso --save-dev
Note: If you installed ESLint globally (using the -g
flag) then you must also install eslint-plugin-wpcalypso
globally.
Add wpcalypso
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": [
"wpcalypso"
]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"wpcalypso/rule-name": 2
}
}
i18n-ellipsis
: Disallow using three dots in translate stringsi18n-mismatched-placeholders
: Ensure placeholder counts match between singular and plural stringsi18n-named-placeholders
: Disallow multiple unnamed placeholdersi18n-no-collapsible-whitespace
: Disallow collapsible whitespace in translatable stringsi18n-no-placeholders-only
: Disallow strings which include only placeholdersi18n-no-this-translate
: Disallow this.translate()i18n-no-variables
: Disallow variables as translate stringsjsx-classname-namespace
: Ensure JSX className adheres to CSS namespace guidelinesjsx-gridicon-size
: Enforce recommended Gridicon size attributesimport-docblock
: Enforce external, internal dependencies docblockspost-message-no-wildcard-targets
: Disallow using the wildcard '*' inpostMessage
import-no-redux-combine-reducers
: Disallow combineReducers import from reduxredux-no-bound-selectors
: Disallow creation of selectors bound to Redux state
Calypso is licensed under GNU General Public License v2 (or later).