An esformatter plugin to format JavaScript according to the WordPress Coding Standards.
npm install esformatter-wordpressThere are various ways to register esformatter-wordpress depending on how you're using esformatter.
When working with esformatter programmatically:
var esformatter = require('esformatter');
var wordpressPreset = require('esformatter-wordpress');
esformatter.register(wordpressPreset);When using the esformatter CLI, register it as a plugin:
esformatter --plugins=esformatter-wordpress <input.js>It's also possible to register esformatter-wordpress in a project, either in an .esformatter configuration file in the project root, your home directory, or in a section in package.json. Read the configuration documentation for more information.
{
"plugins": [
"esformatter-wordpress"
]
}{
"esformatter": {
"plugins": [
"esformatter-wordpress"
]
}
}- Updated the quotes plugin implementation to fix an error caused by a change in the
esformatter-quotesplugin. See #4
- Reworked the package to make it an esformatter plugin.
- Removed the
wpjsCLI utility in favor of using theesformatterCLI directly.