1.7.3 • Published 6 years ago

wpcs v1.7.3

Weekly downloads
6
License
MIT
Repository
github
Last release
6 years ago

:page_with_curl: wpcs

Check WordPress Coding Standards quickly with Node.js without installing any PHP dependencies.

:computer: Install

Using NPM

$ npm install wpcs --save

Using Yarn

$ yarn add wpcs

If you want to use CLI version, please install it globally.

# NPM
$ npm install wpcs -g

# Yarn
$ yarn global add wpcs

:elephant: PHP Scripts

This module depends on these scripts below, using git subtree method under scripts directory.

:books: Usage Example as Module

const WPCS = require('wpcs')

const wpcs = new WPCS(path, rule)

wpcs.on('start', () => {
  // Your script here
})

wpcs.on('scan', filename => {
  // Filename
})

wpcs.on('error', (filename, info) => {
  // Filename, {line: Number, column: Number, message: Number}
})

wpcs.on('warning', (filename, info) => {
  // Filename, {line: Number, column: Number, message: Number}
})

wpcs.on('done', totals => {
  // {errors: Number, warnings: Numbers, files: Numbers}
})

// Get error process
wpcs.process.on('error', err => {
  console.log(err)
})

:zap: CLI

https://gyazo.com/e655bf900ae1693d6d98bcbb1d447d5c

wpcs - Check WordPress Coding Standard

  USAGE
    wpcs [path]

  ARGUMENTS
    [path]    Script path could be a directory or filename. optional

  OPTIONS
    --rule <rulename>   Default rule is WordPress-Extra + WordPress-Docs. WordPress | WordPress-Core | WordPress-Docs | WordPress-Extra | WordPress-VIP. optional
    --autofix           Auto fix errors. optional
    --skip-warning      Skip Warning. optional
    --excludes          Excludes Path. optional

License

MIT © oknoorap

1.7.3

6 years ago

1.7.2

6 years ago

1.7.1

6 years ago

1.7.0

6 years ago

1.6.2

7 years ago

1.6.1

7 years ago

1.6.0

7 years ago

1.5.5

7 years ago

1.5.4

7 years ago

1.5.3

7 years ago

1.5.2

7 years ago

1.5.1

7 years ago

1.5.0

7 years ago

1.4.0

7 years ago

1.3.0

7 years ago

1.2.4

7 years ago

1.2.3

7 years ago

1.2.2

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago