Skip to content
This repository has been archived by the owner on May 14, 2021. It is now read-only.

Commit

Permalink
Add information to README
Browse files Browse the repository at this point in the history
  • Loading branch information
mxstbr committed Oct 23, 2016
1 parent f22eb10 commit f0973b9
Showing 1 changed file with 50 additions and 1 deletion.
51 changes: 50 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,55 @@
# `stylelint-processor-styled-components`

A [stylelint processor](http://stylelint.io/user-guide/configuration/#processors) for using stylelint to lint the CSS in [`styled-components`](https://github.com/styled-components/styled-components).
Lint the CSS in your [`styled-components`](https://github.com/styled-components/styled-components) with `stylelint`!

[![Build Status](https://travis-ci.org/styled-components/stylelint-processor-styled-components.svg?branch=master)](https://travis-ci.org/styled-components/stylelint-processor-styled-components) [![Coverage Status](https://coveralls.io/repos/github/styled-components/stylelint-processor-styled-components/badge.svg?branch=ci)](https://coveralls.io/github/styled-components/stylelint-processor-styled-components?branch=ci)

**NOTE**: This is currently in alpha. While unit-tested, it doesn't yet have a lot of real world project exposure, so there'll be some edge cases we haven't covered. Please try it out and submit bug reports!

## Usage

### Installation

You need:

- `stylelint` (duh)
- This processor (to add `styled-components` support)
- The standard config for stylelint (or any config you like)

```
npm install --save-dev stylelint-processor-styled-components stylelint stylelint-config-standard
```

### Setup

Add a `.stylelintrc` file to the root of your project:

```JSON
{
"processors": ["stylelint-processor-styled-components"],
"extends": "stylelint-config-standard"
}
```

Then you need to actually run `stylelint`.

Add a `lint:css` script to your `package.json`. This script will run `stylelint` with a path to all of your files containing `styled-components` code:

```JSON
{
"scripts": {
"lint:css": "stylelint './components/**/*.js'"
}
}
```

> **NOTE:** Don't worry about passing in files that don't contain any styled-components code – we take care of that.
Now you can lint your CSS by running this script! 🎉

```
npm run lint:css
```

## License

Expand Down

0 comments on commit f0973b9

Please sign in to comment.