eslint-plugin-wordpress
v0.1.0eslint-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-dev
Next, install eslint-plugin-wordpress
:
$ npm install eslint-plugin-wordpress --save-dev
Note: 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
Metadata
- MIT
- >=0.10.0
- Stephen Edgar
- released 2/20/2016