@stackline/vfile-reporter-pretty
vfile utility to create a pretty report for a file.
Documentation | npm | Issues | Repository
Current package version: 1.0.2
Why this package?
@stackline/vfile-reporter-pretty is the Stackline-maintained distribution of vfile-reporter-pretty@6.1.1. It is an independent continuation of vfile-reporter-pretty; original authors and licenses remain credited below.
Compatibility
| Item | Value |
|---|---|
| Package | @stackline/vfile-reporter-pretty@1.0.2 |
| API target | vfile-reporter-pretty@6.1.1 |
| Supported Node.js | See supported framework requirements |
| License | MIT |
| Module type | module |
| Main entry | index.js |
| Types | index.d.ts |
| Runtime dependencies | vfile, vfile-to-eslint, eslint-formatter-pretty |
Installation
npm install @stackline/vfile-reporter-pretty
Preserve existing imports and plugin resolution with an npm alias:
npm install vfile-reporter-pretty@npm:@stackline/vfile-reporter-pretty
Usage and API reference
vfile-reporter-pretty
vfile utility to create a pretty report.
Contents
What is this?
This package is like vfile-reporter but a bit prettier.
When should I use this?
You can use this when you like
eslint-formatter-pretty, use vfile-reporter
itself otherwise.
Install
This package is ESM only. In Node.js (version 14.14+ and 16.0+), install with npm:
npm install @stackline/vfile-reporter-pretty
In Deno with esm.sh:
import {reporterPretty} from 'https://esm.sh/vfile-reporter-pretty@6'
In browsers with esm.sh:
<script type="module">
import {reporterPretty} from 'https://esm.sh/vfile-reporter-pretty@6?bundle'
</script>
Use
import {VFile} from 'vfile'
import {reporterPretty} from '@stackline/vfile-reporter-pretty'
const file = new VFile({path: '~/example.md'})
file.message('`braavo` is misspelt; did you mean `bravo`?', {line: 1, column: 8})
file.info('This is perfect', {line: 2, column: 1})
try {
file.fail('This is horrible', {line: 3, column: 5})
} catch (error) {}
console.log(reporterPretty([file]))
API
This package exports the identifier reporterPretty.
That identifier is also the default export.
reporterPretty(files)
Create a pretty report from files.
Parameters
files(Array<VFile>) — files to report
Returns
Report (string).
Types
This package is fully typed with TypeScript. It exports no additional types.
Compatibility
Projects maintained by the unified collective are compatible with all maintained versions of Node.js. As of now, that is Node.js 14.14+ and 16.0+. Our projects sometimes work with older versions, but this is not guaranteed.
Contribute
See 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.
License
Credits and original authors
- Original project: vfile-reporter-pretty.
- Sindre Sorhus.
- Titus Wormer.
- Stackline maintenance: Alexandro Paixao Marques and Stackline contributors.
Original copyright, license notices and contributor acknowledgements remain part of this distribution. Stackline maintenance does not replace authorship of the original work.
Community and Links
Use this repository's issue tracker for reproducible bugs and feature requests. Join r/Stackline for examples, usage questions and release discussions.