0.2.1 • Published 4 years ago

htmllinter-plugin-stylelint v0.2.1

Weekly downloads
7
License
-
Repository
github
Last release
4 years ago

htmllinter-plugin-stylelint

htmllinter plugin to lint css inside of style tags using stylelint

Installation

yarn add htmllinter-plugin-stylelint --dev

Usage

In your htmllinter.config.js file, include this module in plugin property

htmllinter.config.js

module.exports = {
  plugins: [require('htmllinter-plugin-stylelint')],
  rules: {
    stylelint: 'on',
  },
};

Configuration of Stylelint rules and config

We are using stylelint node api which accepts some option.

Refer here for the options

We dont accept the files as both code and this cant be used together

You can pass these options from htmllinter.config.js 's rules property

Example :

// htmllinter.config.js

module.exports = {
  plugins: [require('htmllinter-plugin-stylelint')],
  rules: {
    stylelint: [
      'on',
      {
        config: {
          rules: {
            indentation: false,
          },
        },
      },
    ],
  },
};