JSPM

unified-consistency

2.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1964
  • Score
    100M100P100Q120286F
  • License MIT

Report inconsistencies between the input and output of a unified pipeline

Package Exports

  • unified-consistency

Readme

unified-consistency

github actions npm version npm downloads

codecov

A unified plugin which reports inconsistencies between the input and what a pipeline would output.

Table of Contents

Installation

npm install unified-consistency

API

This unified plugin stringifies the AST, and reports any differences from the input. You should always specify this plugin last. It works with all unified ecosystems, including remark and rehype.

processor.use(unifiedConsistency)

Options

This plugin has no options.

Compatibility

This project is compatible with Node.js 18 or greater.

Examples

Configuration file

This plugin is best used in a configuration file. For example:

# .remarkrc.yaml
plugins:
  - unified-consistency

Programmatic use

For example, the following script:

import { remark } from 'remark'
import unifiedConsistency from 'unified-consistency'
import { reporter } from 'vfile-reporter'

const processor = remark().use(unifiedConsistency)

const file = await processor.process('#Hello')

console.log(reporter([file]))

Yields:

<stdin>
  1:1-1:7  warning  Replace `#Hello` with `\#Hello⏎`  replace  unified-consistency

⚠ 1 warning

License

MIT © Remco Haszing