1.1.0 • Published 6 months ago

@tiagoporto/stylelint-config v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

@tiagoporto/stylelint-config

Shareable Config for Stylelint.

Installation

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

Usage

// .stylelintrc.mjs
export default {
  extends: ['@tiagoporto/stylelint-config'],
}

In package.json add the following scripts:

{
  "scripts": {
    "lint:styles": "stylelint \"**/*.{css,scss}\"",
    "lint:styles:fix": "stylelint \"**/*.{css,scss}\" --fix"
  }
}

Lint-staged

Check staged markdown

// .lintstagedrc.mjs
export default {
  '*.{scss,vue}': ['stylelint --fix'],
}

Editor

For VSCode is recommended the following extensions:

// .vscode/settings.json
{
  "editor.codeActionsOnSave": {
    "source.fixAll.stylelint": "always"
  },
  "stylelint.validate": ["css", "scss"]
}