@zestia/stylelint-config

Stylelint config

Usage no npm install needed!

<script type="module">
  import zestiaStylelintConfig from 'https://cdn.skypack.dev/@zestia/stylelint-config';
</script>

README

@zestia/stylelint-config

This package provides linting rules for CSS and SCSS.

The rules are based on community standards, with a few extra ones specific to Zestia.

Installation

npm install --save-dev @zestia/stylelint-config

Setup

  1. Create the following file .stylelintrc.js

    module.exports = require('@zestia/stylelint-config');
    
  2. Add the following to scripts in package.json

    "lint:css": "stylelint '**/*.{css,scss}'"
    

Running

npm run lint:css

Notes

  • stylelint-config-standard for a set of community lint rules around best practices and catching errors in css
  • stylelint-config-standard-scss as above, but for scss
  • stylelint-scss for scss specific stylelint rules
  • stylelint-prettier adds prettier as a stylelint rule
  • stylelint-config-prettier for turning off stylelint rules that could conflict with prettier
  • stylelint-selector-bem-pattern for a bem-like naming convention
  • stylelint-declaration-strict-value to enforce variables (e.g. for a consistent colour palette etc)
  • stylelint-order to enforce the order of certain rules

Related repos