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

Commit 55b94d9

Browse files
author
ismay
authored
Merge pull request #57 from emilgoldsmith/patch-1
Add stylelint-disable note in README.md
2 parents 3c43e97 + 5fa5d72 commit 55b94d9

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

README.md

+26
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,32 @@ Now you can lint your CSS by running this script! 🎉
5656
npm run lint:css
5757
```
5858

59+
### Syntax notes
60+
#### Turning rules off from within your CSS
61+
In order for `stylelint-processor-styled-components` to parse your `stylelint-disable` comments (see the [stylelint documentation](https://stylelint.io/user-guide/configuration/#turning-rules-off-from-within-your-css) for all allowed syntax) they must be inside the actual Styled Components CSS as such:
62+
63+
**Wrong**:
64+
```
65+
/* stylelint-disable color-named */
66+
import React from 'react';
67+
import styled from 'styled-components';
68+
69+
const Wrapper = styled.div`
70+
background-color: red;
71+
`;
72+
```
73+
**Right**:
74+
```
75+
import React from 'react';
76+
import styled from 'styled-components';
77+
78+
const Wrapper = styled.div`
79+
/* stylelint-disable declaration-empty-line-before */
80+
background-color: red;
81+
`;
82+
```
83+
84+
5985
## License
6086

6187
Licensed under the MIT License, Copyright © 2016 Maximilian Stoiber. See [LICENSE.md](./LICENSE.md) for more information!

0 commit comments

Comments
 (0)