node package manager

pretty-javascript

pretty-javascript

Pretty-JavaScript is Coveo's JavaScript linter used to lint pure JavaScript files with eslint.

Build Status Commitizen friendly GitHub release version npm npm license

Usage

Install pretty-javascript with npm

  npm install --save-dev pretty-javascript

Add pretty-javascript to your gulp pipeline

  var lint = require('pretty-javascript');
 
  gulp.task('linter', function() {
    gulp
      .src('src/**/*.js')
      .pipe(lint());
  });

Add a global environment variable to your system to allow PrettyJavascript to fail on or after lint errors. By default if there's no variable specified, ESLINT_FAIL_ON_ERROR and ESLINT_FAIL_AFTER_ERROR will fallback to false.

OSX/LINUX:

export ESLINT_FAIL_ON_ERROR=true
  or
export ESLINT_FAIL_ON_ERROR=false (by default)

or

export ESLINT_FAIL_AFTER_ERROR=true
  or
export ESLINT_FAIL_AFTER_ERROR=false (by default)

WINDOWS:

SET ESLINT_FAIL_ON_ERROR=true
  or
SET ESLINT_FAIL_ON_ERROR=false (by default)

or

SET ESLINT_FAIL_AFTER_ERROR=true
  or
SET ESLINT_FAIL_AFTER_ERROR=false (by default)

note: if both variables are set to true, PrettyJavascript will always fail on error.

Extends coveo rules in your .eslintrc file. Example here.

Example

Watch for linter errors/warnings

linter

forthebadge forthebadge forthebadge