@justeattakeaway/stylelint-config-pie

0.7.0 • Public • Published

stylelint-config-pie

npm version

PIE shareable stylelint config.

A Stylelint config used in PIE – Just Eat Takeaway’s design system.

Use it as is or as a foundation for your own config.

To see the rules that this config uses, please read the config itself.

Installation

npm install @justeattakeaway/stylelint-config-pie --save-dev

Usage

Rules

Currently there are 3 different sets of rules:

  1. base - the base rules that we'd advise all projects use and extend as needed.
  2. strict - a smaller collection of optional opinionated rules.
  3. ordering - an even smaller collection of optional rules that specify the ordering of CSS properties.

In your projects

If you've installed stylelint-config-pie locally within your project, just set your stylelint config to:

{
  "extends": "@justeattakeaway/stylelint-config-pie/base"
}

The easiest way to do this is by adding the following section to your package.json:

"stylelint": {
  "extends": "@justeattakeaway/stylelint-config-pie/base"
}

You may only want to use a specific ruleset such as base, strict or ordering. If so, simply point to the ones you'd like to use:

"stylelint": {
  "extends": [
    "@justeattakeaway/stylelint-config-pie/base",
    "@justeattakeaway/stylelint-config-pie/strict",
    "@justeattakeaway/stylelint-config-pie/ordering"
  ]
}

Note: @justeattakeaway/stylelint-config-pie includes all rules. We would strongly recommend using @justeattakeaway/stylelint-config-pie/base and going from there.

If you've globally installed stylelint-config-pie using the -g flag, then you'll need to use the absolute path to stylelint-config-pie in your config e.g.

{
  "extends": "/absolute/path/to/@justeattakeaway/stylelint-config-pie/base"
}

Extending the config

Simply add a "rules" key to your config, then add your overrides and additions there.

For example, to change the indentation to tabs, and turn off the number-leading-zero rule:

{
  "extends": "@justeattakeaway/stylelint-config-pie/base",
  "rules": {
    "indentation": "tab",
    "number-leading-zero": null
  }
}

Documentation

Configured Lints

stylelint-config-pie is a great foundation for your own config. Here is a list of the rules turned on in this config, and what they do:

Base

Strict

Ordering

Package Sidebar

Install

npm i @justeattakeaway/stylelint-config-pie

Weekly Downloads

36

Version

0.7.0

License

Apache-2.0

Unpacked Size

33.1 kB

Total Files

11

Last publish

Collaborators

  • ilia.chikmarev
  • phatpt8
  • anastasiia.horban
  • mmakwe-onyeka
  • gregory.palaci
  • roberto.santana
  • siggerzz
  • lizzie.turney
  • jamieomaguire
  • davidpn.11
  • mwh1989
  • ashleynolan
  • fozzie-bot