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-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:
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
- space-negation-operator: Require space after
!
negation operators. See also https://github.com/eslint/eslint/issues/5060