@icelandair/stylelint-config

1.0.2 • Public • Published

@icelandair/stylelint-config

npm

This package provides Icelandair's stylelint as an extensible shared config extending stylelint-config-recommended.

Additionally it provides an optional csscomb config for automatic css/scss formatting.

Installation

Assuming you already have a valid package.json:

yarn add -D @icelandair/stylelint-config stylelint

or

npm install --save-dev @icelandair/stylelint-config stylelint

Usage

@icelandair/stylelint-config

If you are writing a React application or component your .stylelintrc will look like this:

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

Is is possible to disable or activate additional rules.

Example:

{
  "extends": "@icelandair/stylelint-config",
  "rules": {
    "max-nesting-depth": 4,
  }
}

Full list of rules can be found in stylelints user guide.

To exlude files or folders, create a .stylelintignore file next to the stylelintrc. Documentation in the stylelint user guide

Install stylelint extension to atom, vsCode, sublime to get warnings when editing files.

Add a script in your package.json, example:

"lint:styles": "stylelint 'src/**/*.scss' --fix"

@icelandair/stylelint-config/csscomb.json

To utilise the csscomb config for automatic code formatting you will need to add a .csscomb file to the root of your project.

{
  "extends": "node_modules/@icelandair/stylelint-config/csscomb.json"
}

Additionally you need to install the csscomb plugin to your editor and activate the format on save option.

Atom vsCode Sublime

Package Sidebar

Install

npm i @icelandair/stylelint-config

Weekly Downloads

72

Version

1.0.2

License

MIT

Unpacked Size

12.9 kB

Total Files

6

Last publish

Collaborators

  • danielmar
  • valaasgeirs
  • alexandericelandair
  • davidpxn
  • maelysjs
  • manisig
  • tomasge
  • agustf
  • jakobarni
  • marysomerville
  • trygggvi
  • sindri.markusson
  • andrifannar
  • ingvaro
  • kristjaningi
  • steingrimure
  • steindorf
  • icelandair-labs
  • bjarnij
  • dagursig
  • pajdak
  • susanna_maxon
  • arnorolafsson
  • kalli
  • olafurns
  • gummik