unified

Project: vfile/vfile-to-eslint

Package: vfile-to-eslint@2.0.2

  1. Dependencies: 1·Dependents: 3
  2. vfile utility to convert to ESLint formatter compatible output
  1. util 106
  2. utility 104
  3. file 31
  4. virtual 21
  5. vfile 18
  6. vfile-util 16
  7. vfile-reporter 5
  8. reporter 5
  9. eslint 4

vfile-to-eslint

Build Coverage Downloads Sponsors Backers Chat

Convert VFiles to ESLint formatter compatible output.

For example, remark-lint returns a VFile, which you could pass through this module to display it using an ESLint formatter.

Install

npm:

npm install vfile-to-eslint

Use

const remark = require('remark')
const recommended = require('remark-preset-lint-recommended')
const eslintFormatterPretty = require('eslint-formatter-pretty')
const vfileToEslint = require('vfile-to-eslint')

const file = remark()
  .use(recommended)
  .processSync('## Hello world!')

console.log(eslintFormatterPretty(vfileToEslint([file])))

vfileToEslint(files)

Returns an Object that can be passed directly to an ESLint formatter.

files

List of files (Array.<VFile>).

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

MIT © Sindre Sorhus