Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

stylelint-config-css-modules

pascalduez984.4kUnlicense4.4.0

CSS modules shareable config for stylelint

stylelint, stylelint-config, css-modules

readme

stylelint-config-css-modules

npm version CI Status

CSS modules shareable config for stylelint.

Tweaks stylelint rules to accept css modules specific syntax.
This is useful as an override of pre-defined rules, for instance the stylelint-config-standard.

Installation

npm install stylelint-config-css-modules --save-dev
# or
pnpm install stylelint-config-css-modules --save-dev
# or
yarn add stylelint-config-css-modules --dev

stylelint-config-css-modules comes with stylelint-scss as optionalDependencies, if you're not using SCSS and want to strip it from your node_modules just:

npm install stylelint-config-css-modules --save-dev --no-optional
# or
pnpm install stylelint-config-css-modules --save-dev --no-optional
# or
yarn add stylelint-config-css-modules --dev --ignore-optional

Usage

{
  "extends": [
    "stylelint-config-standard",
    "stylelint-config-css-modules"
  ]
}

Examples

@value colors: './colors.css';
@value primary, secondary from colors;

.base {
  content: 'base';
  color: primary;
}

.composed {
  composes: base;
}

.composedWith {
  compose-with: base;
}

.flexible {
  composes: flex from './utils.css';
  flex-direction: column;
}

:global(.js) .progressive {
  display: block;
}

:export {
  black: #000;
  white: #111;
}

SCSS

Using SCSS along with configs such as stylelint-config-standard-scss means you should necessarily have stylelint-scss installed.

{
  "extends": [
    "stylelint-config-standard-scss",
    "stylelint-config-css-modules"
  ]
}

Credits

Licence

stylelint-config-css-modules is unlicensed.

changelog

Change Log

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

Unreleased

[4.4.0] - 2023-12-20

Added

  • Add support for Stylelint 16. None of the breaking changes are impacting this config. It stays compatible with previous Stylelint versions.

Changed

  • Converted to an ES module, but with added support for commonjs. It should be transparent to consumers.

[4.3.0] - 2023-07-19

Added

4.2.0 - 2023-02-10

Added

  • Add support for Stylelint 15. None of the breaking changes are impacting this config. It stays compatible with Stylelint ^14.5.1.

4.1.0 - 2022-03-16

Added

  • SCSS, use the function-no-unknow rule from stylelint-scss >= 4.2.

Changed

  • Stylelint peerDependency version to ^14.5.1 (required by the function-no-unknown rule).

4.0.1 - 2022-03-11

Fixed

  • Missing SCSS plugin declaration.

4.0.0 - 2022-03-11

Added

3.0.0 - 2022-02-11

Changed

2.3.0 - 2021-10-25

Added

  • Add support for Stylelint 14.

2.2.0 - 2020-01-12

Added

  • Add support for Stylelint 13.

2.1.0 - 2019-11-18

Added

  • Add support for Stylelint 12.

2.0.0 - 2019-11-04

Added

  • Add support for :export and :import() selectors.

Changed

  • Breaking Only support Stylelint 11 onwards.

1.5.0 - 2019-09-16

Added

  • Add support for Stylelint 11.

1.4.0 - 2019-04-14

Added

  • Add support for Stylelint 10.

1.3.0 - 2018-06-23

Added

1.2.0 - 2018-02-18

Added

  • Add support for Stylelint 9.

1.1.0 - 2017-07-17

Added

  • Add support for Stylelint 8.

1.0.0 - 2017-04-17

Added

  • Add support for the compose-with property.

0.1.0 - 2016-09-12

  • Initial release.