posthtml-bem-linter

0.1.4 • Public • Published

posthtml-bem-linter npm version

Pure function and posthtml plugin for linting a bem html. Fork of gulp-html-bemlinter.

Additions:

  • Support modifier option (default value is --).
  • No flood on success.

Usage

First, install posthtml-bem-linter as a development dependency:

npm i --DE posthtml-bem-linter

Then, add it to your posthtml.config.js:

const { getPosthtmlBemLinter } = require('posthtml-bem-linter');

module.exports = {
  plugins: [
    getPosthtmlBemLinter({
      getSourceName: (filename) => filename,
      log: console,
      modifier: '--'
    })
  ]
};

(There are default values of optional params getSourceName, log and modifier in this example.)

Or use function lintBem in pure Node:

const { lintBem } = require('posthtml-bem-linter');

// ...

lintBem({
  name,
  content,
  log: console,
  modifier: '--'
});

(There are default values of optional params log and modifier in this example.)

Readme

Keywords

Package Sidebar

Install

npm i posthtml-bem-linter

Weekly Downloads

0

Version

0.1.4

License

ISC

Unpacked Size

8.6 kB

Total Files

7

Last publish

Collaborators

  • efiand