@morev/stylelint-config

5.4.1 • Public • Published

Promo image of @morev/stylelint-config package

Stability of "master" branch License: MIT Last commit Release version GitHub Release Date Keywords

@morev/stylelint-config

Strict shareable Stylelint configuration with reasonable defaults.

✔️ 200+ configured rules of Stylelint and its plugins;
✔️ 70+ extra rules for SCSS;
✔️ Consistent order of properties and rules according to BEM methodology.


Installation

Using yarn

yarn add stylelint @morev/stylelint-config --dev

Using npm

npm install -D stylelint @morev/stylelint-config

Using pnpm

pnpm add -d stylelint @morev/stylelint-config

Usage

Create a Stylelint configuration file (.stylelintrc.js for the following instruction) in the package root with the following content:

Note: the following instruction assumes that the package is written in ESM.

For projects written in CommonJS (that doesn't have "type": "module" within its package.json) you need to specify .cjs extension for configuration file and use module.exports instead of export default.

Alternatively you can use a configuration file defined in YAML or JSON format, but it's less extensible.

SCSS repository (default)

/** @type {import('stylelint').Config} */
export default {
  extends: [
    '@morev/stylelint-config',
  ],
  rules: {},
}

CSS repository

/** @type {import('stylelint').Config} */
export default {
  extends: [
    '@morev/stylelint-config/css',
  ],
  rules: {},
}

Mixed (for some reason O_o) repository

/** @type {import('stylelint').Config} */
export default {
  overrides: [
    { files: ['*.css'], extends: ['@morev/stylelint-config/css'] }
    { files: ['*.scss'], extends: ['@morev/stylelint-config/scss'] }
  ]
}

Package Sidebar

Install

npm i @morev/stylelint-config

Weekly Downloads

16

Version

5.4.1

License

MIT

Unpacked Size

71.7 kB

Total Files

9

Last publish

Collaborators

  • morev