# css-modules-flow-types-loader

> Webpack loader creating Flow type definitions from CSS Modules files

Latest version **2.0.0** (published 2021-06-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install css-modules-flow-types-loader
pnpm add css-modules-flow-types-loader
yarn add css-modules-flow-types-loader
bun add css-modules-flow-types-loader
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2021-06-16 |
| First published | 2017-06-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8 |
| Dependencies | 1 |
| Unpacked size | 4.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 92 |
| Author | skovhus |
| Maintainers | skovhus |
| Keywords | css-modules, types, flow, webpack, webpack loader |

## Links

- npm: https://www.npmjs.com/package/css-modules-flow-types-loader
- Repository: https://github.com/skovhus/css-modules-flow-types
- Homepage: https://github.com/skovhus/css-modules-flow-types#readme
- Issues: https://github.com/skovhus/css-modules-flow-types/issues
- npm.io page: https://npm.io/package/css-modules-flow-types-loader

## Dependencies (1)

- [css-modules-flow-types-printer](https://npm.io/package/css-modules-flow-types-printer.md) ^2.0.0

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2021-06-16
- 1.4.1 — 2020-08-12
- 1.4.0 — 2020-08-12
- 1.3.0 — 2019-05-27
- 1.2.0 — 2019-04-12
- 1.1.1 — 2018-09-17
- 1.1.0 — 2017-10-15
- 1.0.1 — 2017-10-13
- 1.0.0 — 2017-10-13
- 0.3.1 — 2017-06-20
- 0.2.2 — 2017-06-18
- 0.2.1 — 2017-06-18
- 0.2.0 — 2017-06-18
- 0.1.2 — 2017-06-16
- 0.1.1 — 2017-06-16
- … 1 more at https://npm.io/package/css-modules-flow-types-loader/versions

## README

# css-modules-flow-types-loader [![npm version](https://badge.fury.io/js/css-modules-flow-types-loader.svg)](http://badge.fury.io/js/css-modules-flow-types-loader)

Webpack loader for creating [Flow](https://flow.org/) type definitions based on [CSS Modules](https://github.com/css-modules/css-modules) files.

This gives you:
- auto-completing for css files in most editors
- flow type safety showing usage of non existing classes


## Example

Given the following css file using CSS Modules:
```css
@value primary: red;

.myClass {
  color: primary;
}
```

`css-modules-flow-types` creates the following .flow file next to it:

```javascript
// @flow
/* This file is automatically generated by css-modules-flow-types */
declare module.exports: {|
  +'myClass': string;
  +'primary': string;
|};
```


## Usage

The `css-modules-flow-types-loader` need to be added right after after `style-loader`:

```sh
$ npm install --dev css-modules-flow-types-loader
$ yarn install -D css-modules-flow-types-loader
```

```javascript
{
  test: /\.css$/,  // or the file format you are using for your CSS Modules
  use: [
    'style-loader',
    'css-modules-flow-types-loader',
    // Other loaders like css-loader after this:
    {
      ...
    }
  ]
}
```


## Inspiration
- https://github.com/Quramy/typed-css-modules
- https://github.com/Jimdo/typings-for-css-modules-loader


## License
This software is released under the MIT License.

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