@selective/lint

0.3.0 • Public • Published

selective lint

NPM Version Linux Build Status Windows Build status

Creates a Rehype plugin from JSON rules to check for HTML anti patterns and reports issues back as vFile messages

Installation

# npm
npm install @selective/lint

# yarn
yarn add @selective/lint

Usage

const rehype = require("rehype");
const lint = require("@selective/lint");
const { readFileSync } = require("fs");

rehype()
  .use(lint, [
    {
      name: "img-alt",
      description: "image tag must contain an alt property",
      recommended: "warn",
      selector: "img:not([alt])",
    },
  ])
  .process(readFileSync("somefile.html"), (err) => {
    console.error(err);
  });

References

Package Sidebar

Install

npm i @selective/lint

Weekly Downloads

1

Version

0.3.0

License

MIT

Unpacked Size

5.35 kB

Total Files

5

Last publish

Collaborators

  • christianmurphy