# stylelint-config-css-modules

> CSS modules shareable config for stylelint

Latest version **4.6.0** (published 2026-01-23) · Unlicense license · 0 weekly downloads

## Install

```sh
npm install stylelint-config-css-modules
pnpm add stylelint-config-css-modules
yarn add stylelint-config-css-modules
bun add stylelint-config-css-modules
```

## Health

**Score 50/100 (C)** — status: stable.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 4.6.0 |
| Published | 2026-01-23 |
| First published | 2016-09-12 |
| Weekly downloads | 0 |
| License | Unlicense |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 13.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 113 |
| Author | Pascal Duez |
| Maintainers | pascalduez |
| Keywords | stylelint, stylelint-config, css-modules |

## Links

- npm: https://www.npmjs.com/package/stylelint-config-css-modules
- Repository: https://github.com/pascalduez/stylelint-config-css-modules
- Issues: https://github.com/pascalduez/stylelint-config-css-modules/issues
- npm.io page: https://npm.io/package/stylelint-config-css-modules

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@inrupt/eslint-config-base](https://npm.io/package/@inrupt/eslint-config-base.md) — 4.5K weekly downloads

## Recent versions

- 4.6.0 (latest) — 2026-01-23
- 4.5.1 — 2025-06-30
- 4.5.0 — 2025-06-22
- 4.4.1 — 2025-06-20
- 4.4.0 — 2023-12-20
- 4.3.0 — 2023-07-19
- 4.2.0 — 2023-02-10
- 4.1.0 — 2022-03-16
- 4.0.1 — 2022-03-11
- 4.0.0 — 2022-03-11
- 3.0.0 — 2022-02-11
- 2.3.0 — 2021-10-25
- 2.2.0 — 2020-01-12
- 2.1.0 — 2019-11-18
- 2.0.0 — 2019-11-04
- … 7 more at https://npm.io/package/stylelint-config-css-modules/versions

## README

# stylelint-config-css-modules

[![npm version][npm-image]][npm-url]
[![CI Status][ci-image]][ci-url]

> 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

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

## Examples

```css
@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.

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

## Credits

- [Pascal Duez](https://github.com/pascalduez)

## Licence

stylelint-config-css-modules is [unlicensed](http://unlicense.org/).

[npm-url]: https://www.npmjs.org/package/stylelint-config-css-modules
[npm-image]: http://img.shields.io/npm/v/stylelint-config-css-modules.svg?style=flat-square
[ci-url]: https://github.com/pascalduez/stylelint-config-css-modules/actions/workflows/ci.yml
[ci-image]:  https://img.shields.io/github/actions/workflow/status/pascalduez/stylelint-config-css-modules/ci.yml?branch=main&style=flat-square

[stylelint]: https://github.com/stylelint/stylelint
[css modules]: https://github.com/css-modules/css-modules
[stylelint-scss]: https://github.com/stylelint-scss/stylelint-config-standard-scss
[stylelint-config-standard]: https://github.com/stylelint/stylelint-config-standard
[stylelint-config-standard-scss]: https://github.com/stylelint-scss/stylelint-config-standard-scss

---
_Source: https://npm.io/package/stylelint-config-css-modules · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
