项目作者: cedaro

项目描述 :
Format JavaScript according to the WordPress Coding Standards.
高级语言: JavaScript
项目地址: git://github.com/cedaro/esformatter-wordpress.git
创建时间: 2015-07-06T18:25:38Z
项目社区:https://github.com/cedaro/esformatter-wordpress

开源协议:MIT License

下载


esformatter-wordpress

An esformatter plugin to format JavaScript according to the WordPress Coding Standards.

Installation

  1. npm install esformatter-wordpress

Usage

There are various ways to register esformatter-wordpress depending on how you’re using esformatter.

API

When working with esformatter programmatically:

  1. var esformatter = require('esformatter');
  2. var wordpressPreset = require('esformatter-wordpress');
  3. esformatter.register(wordpressPreset);

CLI

When using the esformatter CLI, register it as a plugin:

  1. esformatter --plugins=esformatter-wordpress <input.js>

Configuration Files

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.

.esformatter

  1. {
  2. "plugins": [
  3. "esformatter-wordpress"
  4. ]
  5. }

package.json

  1. {
  2. "esformatter": {
  3. "plugins": [
  4. "esformatter-wordpress"
  5. ]
  6. }
  7. }

Changelog

0.2.1

  • Updated the quotes plugin implementation to fix an error caused by a change in the esformatter-quotes plugin. See #4

0.2.0

  • Reworked the package to make it an esformatter plugin.
  • Removed the wpjs CLI utility in favor of using the esformatter CLI directly.