eslint-formatter-pretty
TypeScript icon, indicating that this package has built-in type declarations

6.0.1 • Public • Published

eslint-formatter-pretty

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@5

To use this with ESLint, use version 5. Version 6 is not compatible with ESLint.

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

import gulp from 'gulp';
import eslint from 'gulp-eslint';

export const lint = (
	gulp.src('file.js')
		.pipe(eslint())
		.pipe(eslint.format('pretty'))
);

eslint-loader (webpack)

import eslintFormatterPretty from 'eslint-formatter-pretty';

export default {
	entry: ['file.js'],
	module: {
		rules: [
			{
				test: /\.js$/,
				exclude: /node_modules/,
				loader: 'eslint-loader',
				options: {
					formatter: eslintFormatterPretty
				}
			}
		]
	}
};

Tips

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

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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
6.0.1102,426latest

Version History

VersionDownloads (Last 7 Days)Published
6.0.1102,426
6.0.0551
5.0.058,237
4.1.0363,557
4.0.019,580
3.0.134,297
3.0.014
2.1.135,273
2.1.01,190
2.0.072
1.3.060,230
1.2.02
1.1.05,028
1.0.12
1.0.02
0.3.1299
0.3.02
0.2.216,771
0.2.12
0.2.02
0.1.15
0.1.02

Package Sidebar

Install

npm i eslint-formatter-pretty

Weekly Downloads

521,978

Version

6.0.1

License

MIT

Unpacked Size

8.87 kB

Total Files

5

Last publish

Collaborators

  • sindresorhus