1.0.1 • Published 3 years ago

@scss-toolkit/config-stylelint v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

config-stylelint

Opinionated Stylelint config for SCSS

Installing

npm i -D stylelint @scss-toolkit/config-stylelint

Extending your Stylelint configuration

{
  "extends": "@scss-toolkit/config-stylelint"
}

If you only need to extend specific functionality, you can choose one or more from the available modules (listed below)

{
  "extends": [
    "@scss-toolkit/config-stylelint/stylelint-css",
    "@scss-toolkit/config-stylelint/stylelint-scss",
    "@scss-toolkit/config-stylelint/stylelint-order",
    "@scss-toolkit/config-stylelint/stylelint-prettier"
  ]
}

Know more about extending stylelint configuration

Configuration modules

The configuration has been split into 4 parts.

  1. CSS: stylelint-css.js
  2. SCSS: stylelint-scss.js
  3. ORDER: stylelint-order.js
  4. PRETTIER: stylelint-prettier.js
    • This should be placed at the end, since it disables rules to match prettier config.

The default exports of the package index.js extends all the above in the below order:

module.exports = {
  extends: [
    './stylelint-css.js',
    './stylelint-scss.js',
    './stylelint-order.js',
    './stylelint-prettier.js'
    ],
}

Starting point for this repo:

The starting pointn for the configuration are the below repositories:

Motivation behind the initiative

  • TODO: Create a more restrictive linting configurations targeted specifically for dart-scss and emphasising using @use over @import.
  • create a single package for all the configurations needs for any scss project. (eg. css only configurations, scss configurations, prettier related configurations, optional ordering configuration for css propertieds, anything new in future)

Current state

  • The configurations are copied from the repos mentioned above and minor changes has been added in place.