README
Eslint plugin wpcalypso
Custom ESLint rules for the WordPress.com Calypso project.
Installation
Install ESLint amd eslint-plugin-wpcalypso
$ yarn add --dev eslint eslint-plugin-wpcalypso
Usage
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
}
}
Supported Rules
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, WordPress dependencies docblockspost-message-no-wildcard-targets
: Disallow using the wildcard '*' inpostMessage
redux-no-bound-selectors
: Disallow creation of selectors bound to Redux state