@fabb/stylelint-processor-styled-components
A stylelint processor for styled-components
Last updated 9 months ago by fabb .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @fabb/stylelint-processor-styled-components 
SYNC missed versions from official npm registry.

stylelint-processor-styled-components

Lint your styled components with stylelint!

Build Status Coverage Status Join the community on Spectrum Greenkeeper

Video of project in use

Setup

You need:

(npm install --save-dev
  stylelint
  stylelint-processor-styled-components
  stylelint-config-styled-components
  stylelint-config-recommended)

Now use those in your .stylelintrc and run stylelint with your JavaScript files!

{
  "processors": ["stylelint-processor-styled-components"],
  "extends": [
    "stylelint-config-recommended",
    "stylelint-config-styled-components"
  ]
}

NOTE: The processor works with Flow- and TypeScript-typed files too! (we'll assume TypeScript usage if your files end in .ts or .tsx)

Documentation

Further documentation for this processor lives on the styled-components website!

F.A.Q.

Why does it throw Unexpected token? Even thought the file didn't import styled-components.

You can custom babel plugins by option.parserPlugins now. An API example is our test. But if someone can implement #231, that will be much better.

Why does it throw unexpected lint errors?

The processor can not always parse interpolations with right things. But you can use interpolation-tagging to help it. If you have ideas to make it more intelligent, feel free to send a PR or share your solution by an new issue.

I don't want specified tagged template literal to be parsed, i.e. css.

You can set option.strict. More examples are in #258.

License

Licensed under the MIT License, Copyright © 2017 Maximilian Stoiber. See LICENSE.md for more information!

Based on Mapbox' excellent stylelint-processor-markdown, thanks to @davidtheclark!

Current Tags

  • 1.9.0-alpha1                                ...           latest (9 months ago)

1 Versions

  • 1.9.0-alpha1                                ...           9 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 0
Dependencies (4)
Dev Dependencies (12)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |