Validate files with XO


Keywords
gulpplugin, xo, xoxo, hugs, kisses, happy, happiness, code, quality, style, lint, linter, jscs, jshint, jslint, eslint, validate, code style, standard, strict, check, checker, verify, enforce, hint, simple, gulp, gulp-plugin, javascript, nodejs
License
MIT
Install
npm install gulp-xo@0.26.0

Documentation

gulp-xo

Validate files with XO

Issues regarding rules should be reported on the ESLint issue tracker as it's the actual linter.

Install

$ npm install --save-dev gulp-xo

Usage

const gulp = require('gulp');
const xo = require('gulp-xo');

exports.default = () => (
	gulp.src('src/app.js')
		.pipe(xo())
		.pipe(xo.format())
		.pipe(xo.failAfterError())
);

API

xo(options?)

options

Type: object

Any additional options to the below are passed directly to XO. However, you should prefer setting your XO config in package.json so editors and other tools can also read it. Only pass them here if you want to use options different from those of your current project. You might want to do this if your Gulp task lints or builds files that are/will be part of a separate project.

fix

Type: boolean

This option instructs ESLint to try to fix as many issues as possible. The fixes are applied to the gulp stream. The fixed content can be saved to file using gulp.dest (See example/fix.js). Rules that are fixable can be found in ESLint's rules list.

When fixes are applied, a "fixed" property is set to true on the fixed file's ESLint result.

quiet

Type: boolean
Default: false

Report errors only.

xo.format(formatter, output)

xo.failAfterError()

xo.failOnError()

xo.formatEach(formatter, output)

xo.result(action)

xo.results(action)

  • gulp-eslint - Gulp plugin for ESLint
  • gulp-reporter - Error reporter for CSSLint, EditorConfig, ESLint, HTMLHint, PostCSS, TSLint, XO