Skip to content

Latest commit

 

History

History
72 lines (56 loc) · 1.76 KB

File metadata and controls

72 lines (56 loc) · 1.76 KB

Stylelint

Add the configuration to your repository (for instance in .stylelintrc or .stylelintrc.json or the stylelint parameter in package.json):

{
  "extends": "@davidsneighbour/stylelint-config"
}

To change parts of the configuration use the rules parameter.

{
  "extends": "@davidsneighbour/stylelint-config",
  "rules": {
    "max-nesting-depth": null
  }
}

Add scripts to your package.json:

{
  "scripts": {
    "lint:styles": "stylelint assets/scss/",
    "lint:styles:fix": "stylelint assets/scss/ --fix",
    "lint:styles:config": "stylelint --print-config index.js"
  }
}

Exchange the assets/scss/ with your own styles folder.

Usage

Run stylelint and show errors and warnings:

npm run stylelint

Run stylelint and fix automatically fixable issues:

npm run stylelint:fix

Print the current stylelint configuration:

npm run stylelint:config

All configurations

Configurations
Build Tools
Babel Webpack
Testing
Cypress HTML Validate
Linters and Formatters
Browserslist ESLint PostCSS
Prettier Stylelint
Project Management
Commitlint Release
Markdown and Writing
Markdownlint Remark Lint
Other Tools
Bootstrap Tools