unified

Project:vfile/vfile-to-eslint

Package:vfile-to-eslint@2.0.1

  1. Dependencies:1·Dependents:3
  2. Convert VFiles to ESLint formatter compatible output
  1. remark 165
  2. lint 70
  3. file 14
  4. vfile 13
  5. virtual 12
  6. reporter 5
  7. eslint 4
  8. formatter 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

Usage

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, organisation, or community you agree to abide by its terms.

License

MIT © Sindre Sorhus