|
|
5 hari lalu | |
|---|---|---|
| .. | ||
| node_modules | 5 hari lalu | |
| index.js | 5 hari lalu | |
| license | 5 hari lalu | |
| package.json | 5 hari lalu | |
| readme.md | 5 hari lalu | |
Create a report for a vfile.
3:2 and 3:2-3:6)npm:
npm install vfile-reporter
Say example.js contains:
var vfile = require('vfile')
var reporter = require('vfile-reporter')
var one = vfile({path: 'test/fixture/1.js'})
var two = vfile({path: 'test/fixture/2.js'})
one.message('Warning!', {line: 2, column: 4})
console.error(reporter([one, two]))
Now, running node example yields:
test/fixture/1.js
2:4 warning Warning!
test/fixture/2.js: no issues found
⚠ 1 warning
reporter(files[, options])Generate a stylish report from the given vfile, Array.<VFile>,
or Error.
optionsoptions.verboseOutput long form descriptions of messages, if applicable (boolean, default:
false).
options.quietDo not output anything for a file which has no warnings or errors (boolean,
default: false).
The default behavior is to show a success message.
options.silentDo not output messages without fatal set to true (boolean, default:
false).
Also sets quiet to true.
options.colorWhether to use color (boolean, default: depends).
The default behavior is the check if color is supported.
options.defaultNameLabel to use for files without file-path (string, default: '<stdin>').
If one file and no defaultName is given, no name will show up in the report.
vfile-reporter-json
— JSON reportervfile-reporter-pretty
— Pretty reporterconvert-vinyl-to-vfile
— Convert from Vinylvfile-statistics
— Count messages per categoryvfile-sort
— Sort messages by line/columnSee contributing.md in vfile/.github for ways to
get started.
See support.md for ways to get help.
This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.
Forked from ESLint’s stylish reporter (originally created by Sindre Sorhus), which is Copyright (c) 2013 Nicholas C. Zakas, and licensed under MIT.