GitXplorerGitXplorer
m

eslint-plugin-clean-styled-components

public
40 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
0a693032bfade2057ec09d0ec70fb41d0cbcf9cf

Better documentation

committed 5 years ago
Unverified
16978e96350ea45916d017be3bf7ea9543e40de0

v0.0.2

committed 5 years ago
Unverified
2b58ca46635daeaf676022fceeec69a1ed3c9c0b

Handle styled.x({}) syntax

committed 5 years ago
Unverified
d24d3d4651bd21a93566c9364b617586c98eb000

v0.0.1

committed 5 years ago
Unverified
b7d74890561c1a22c36e801eddcd6c5e65bc2f92

Report errors at the correct nodes

committed 5 years ago
Unverified
f2e18ac01111c7a08559c7c9ac40dd1b32644b4f

Implement React component detection

committed 5 years ago

README

The README file for this repository.

eslint-plugin-clean-styled-components

Lint your styled-components code to be clean

Installation

You'll first need to install ESLint:

$ npm install eslint --dev

Next, install eslint-plugin-clean-styled-components:

$ npm install eslint-plugin-clean-styled-components --dev

Note: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-clean-styled-components globally.

Usage

Add clean-styled-components to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
    "plugins": [
        "clean-styled-components"
    ]
}

Then configure the rules you want to use under the rules section.

{
    "plugins": [
        "clean-styled-components"
    ],
    "rules": {
        "clean-styled-components/single-component-per-file": 2
    }
}

If you want to enable all recommended rules, extend the eslint:recommended config:

{
    "plugins": [
        "clean-styled-components"
    ],
    "extends": ["eslint:recommended"]
}

Supported Rules

  • single-component-per-file: enforce only having a single styled component per source file