eslint-plugin-wordpress v0.1.0
eslint-plugin-wordpress
A collection of custom ESLint rules that help enforce JavaScript coding standard in the WordPress project.
Installation
You'll first need to install ESLint:
$ npm i eslint --save-devNext, install eslint-plugin-wordpress:
$ npm install eslint-plugin-wordpress --save-devNote: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-wordpress globally.
Usage
Add wordpress to the plugins section of your .eslintrc.json configuration file. You can omit the eslint-plugin- prefix:
{
"plugins": [
"wordpress"
]
}Or add wordpress to the plugins section of your .eslintrc.js configuration file. You can omit the eslint-plugin- prefix:
{
"plugins": [
"wordpress"
]
}Or add wordpress to the plugins section of your .eslintrc.yaml/.eslintrc.yml configuration file. You can omit the eslint-plugin- prefix:
{
"plugins": [
"wordpress"
]
}http://eslint.org/docs/user-guide/configuring.html#configuration-file-formats
Then configure the rules you want to use under the rules section.
{
"rules": {
"wordpress/space-negation-operator": 2
}
}Rules
- space-negation-operator: Require space after
!negation operators. See also https://github.com/eslint/eslint/issues/5060
Ressources
Code Sources, References
10 years ago