0.8.0 • Published 9 months ago

@justeattakeaway/stylelint-config-pie v0.8.0

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
9 months ago

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

Changelog

0.8.0

9 months ago

0.7.0

1 year ago

0.6.1

1 year ago

0.6.0

1 year ago

0.5.0

2 years ago

0.4.1

2 years ago

0.4.2

2 years ago

0.4.0

2 years ago

0.3.0

2 years ago

0.2.0

2 years ago