eslint-formatter-pretty
Pretty ESLint formatter
Last updated 9 months ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install eslint-formatter-pretty 
SYNC missed versions from official npm registry.

eslint-formatter-pretty Build Status

Pretty formatter for ESLint

Highlights

  • Pretty output.
  • Sorts results by severity.
  • Stylizes inline codeblocks in messages.
  • Command-click a rule ID to open its docs.
  • Command-click a header to reveal the first error in your editor. (iTerm-only)

Install

$ npm install --save-dev eslint-formatter-pretty

Usage

XO

Nothing to do. It's the default formatter.

ESLint CLI

$ eslint --format=pretty file.js

grunt-eslint

grunt.initConfig({
	eslint: {
		target: ['file.js'].
		options: {
			format: 'pretty'
		}
	}
});

grunt.loadNpmTasks('grunt-eslint');
grunt.registerTask('default', ['eslint']);

gulp-eslint

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

gulp.task('lint', () =>
	gulp.src('file.js')
		.pipe(eslint())
		.pipe(eslint.format('pretty'))
);

eslint-loader (webpack)

module.exports = {
	entry: ['file.js'],
	module: {
		rules: [
			{
				test: /\.js$/,
				exclude: /node_modules/,
				loader: 'eslint-loader',
				options: {
					formatter: require('eslint-formatter-pretty')
				}
			}
		]
	}
};

Tips

In iTerm, <kbd>Command</kbd>-click the filename header to open the file in your editor.

In terminals with support for hyperlinks, <kbd>Command</kbd>-click the rule ID to open its docs.

License

MIT © Sindre Sorhus

Current Tags

  • 2.1.1                                ...           latest (9 months ago)

15 Versions

  • 2.1.1                                ...           9 months ago
  • 2.1.0                                ...           9 months ago
  • 2.0.0                                ...           a year ago
  • 1.3.0                                ...           2 years ago
  • 1.2.0                                ...           2 years ago
  • 1.1.0                                ...           3 years ago
  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
  • 0.3.1                                ...           3 years ago
  • 0.3.0                                ...           3 years ago
  • 0.2.2                                ...           3 years ago
  • 0.2.1                                ...           3 years ago
  • 0.2.0                                ...           4 years ago
  • 0.1.1                                ...           4 years ago
  • 0.1.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 10
This Week 2,393
This Month 16,726
Last Day 1,240
Last Week 6,777
Last Month 25,243
Dependencies (7)
Dev Dependencies (3)

Copyright 2014 - 2016 © taobao.org |