Skip to content

levakorg/stylelint-config

Repository files navigation

@levakorg/stylelint-config

Stylelint config levakorg org's

Setup

1. Installation

npm install --save-dev stylelint prettier @levakorg/stylelint-config

or

yarn add --dev stylelint prettier @levakorg/stylelint-config

2. Configuration

package.json

{
  "stylelint": {
    "extends": ["@levakorg/stylelint-config"]
  }
}

.stylelintrc | .stylelintrc.json

{
  "extends": ["@levakorg/stylelint-config"]
}

.stylelintrc.js

module.exports = {
  extends: ['@levakorg/stylelint-config']
}

3. Add scripts

{
  "stylelint": "stylelint '{**/*,*}.{css,less,scss,sass,styl,stylus,styled.js,styled.ts}' --allow-empty-input",
  "stylelint:fix": "stylelint '{**/*,*}.{css,less,scss,sass,styl,stylus,styled.js,styled.ts}' --allow-empty-input --fix",
}

4. Using scripts

npm run stylelint
npm run stylelint:fix

or

yarn stylelint
yarn stylelint:fix

Notes

1. Using preprocessors

@levakorg/stylelint-config/less
@levakorg/stylelint-config/scss
@levakorg/stylelint-config/sass
@levakorg/stylelint-config/stylus
@levakorg/stylelint-config/styled-components

or use a total config

@levakorg/stylelint-config/total

2. Config / Performance

  • css
  • less
    • May not recover the first time
  • scss
    • May not recover the first time
  • sass
    • Disabled prettier config
  • stylus
    • Disabled prettier config
  • styled-components
    • Requires .styled.js / .styled.ts extension
    • Does not declare ignored properties
  • total