$ yarn add stylelint stylelint-config-standard stylelint-processor-glamorous --devYou can use
styleiint-config-recomendedor your own custom config. Certain rules that enforce formatting rules will be ignored.
{
"processors": ["stylelint-processor-glamorous"],
"extends": "stylelint-config-standard"
}That's it. You can now run stylelint from the command line.
$ yarn stylelint 'src/**/*.js'-
Glamorous component factories
import glamorous from 'glamorous'; // choose any name for the defaut export const Component = glamorous.div({ ... }); const OtherComponent = glamorous('div')({ ... })
-
CSS attributes
<Div css={{ ... }}/>
-
Annotated object literals.
export const styles = // @css { ... }
The
@csscomment tells the processor that its a style object. Make sure you put it right before the opening brace.
You can use @css to lint any object. Hoverver, if you stick to the styled pattern, you won't need to add annotations to your code.
import styled from 'my-fav-cssinjs-lib';
const Component = styled.div({ ... })
const OtherComponent = styled('div')({ ... }) Contributions of any kind are always welcome.
LICENSE: MIT