npm

Need private packages and team management tools?Check out npm Orgs. »

vfile-sort

2.2.1 • Public • Published

vfile-sort

Build Coverage Downloads Size Sponsors Backers Chat

Sort vfile messages.

  • First sorts by line/column: earlier messages come first
  • If two messages occurred at the same place, sorts fatal error before warnings, before info messages
  • Otherwise, uses localeCompare to compare source, ruleId, or finally reason

Install

npm:

npm install vfile-sort

Usage

var vfile = require('vfile')
var sort = require('vfile-sort')
 
var file = vfile()
 
file.message('Error!', {line: 3, column: 1})
file.message('Another!', {line: 2, column: 2})
 
sort(file)
 
console.log(file.messages.map(String))
// => ['2:2: Another!', '3:1: Error!']

API

sort(file)

Sort messages in the given 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 © Titus Wormer

install

npm i vfile-sort

Downloadsweekly downloads

109,799

version

2.2.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability