Skip to content

codesect/stylelint-config

Repository files navigation

@codesect/stylelint-config

Shared stylelint config for all CodeSect projects. This config is based on stylelint-config-standard.

Install

npm install -D @codesect/stylelint-config
# Or with yarn:
yarn add @codesect/stylelint-config --dev

This package requires stylelint version 11 or greater. You can either install it yourself as a dev dependency or use npx install-peerdeps ... which will install both our stylelint config and its peers:

npx install-peerdeps --dev @codesect/stylelint-config

Usage

You can reference/extend the config in your .stylelintrc config object. This will serve as a base for your config.

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

You can override the rules by adding a "rules" key to your config file. For example, if you want to allow ID selectors, you can set selector-max-id to null and to use tabs instead of spaces, you can set indentation to tab:

{
  "extends": "@codesect/stylelint-config",
  "rules": {
    "indentation": "tab",
    "selector-max-id": null
  }
}

Presets

In addition to the default preset, there is also an SCSS preset. This preset extends @codesect/stylelint-config.

SCSS

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

License

MIT © Zsolt Meszaros