1.0.1 • Published 7 years ago

eslint-plugin-css-in-js v1.0.1

Weekly downloads
14
License
MIT
Repository
github
Last release
7 years ago

Build Status version Coverage Status

eslint-plugin-css-in-js

For all your CSS JS object linting need! Not really, it's just linting your CSS properties now for objects that have at least one valid CSS property.

Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install eslint-plugin-css-in-js:

$ npm install eslint-plugin-css-in-js --save-dev

Note: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-css-in-js globally.

Usage

Add css-in-js to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
    "plugins": [
        "css-in-js"
    ]
}

or enable all the rules

{
    "plugins": [
      "css-in-js:recommended"
    ]
}

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

{
    "rules": {
        "css-in-js/rule-name": 2
    }
}

Supported Rules

RuleDescription
no-invalid-propertiesDisallow invalid CSS properties

Contributing

This plugin is pretty lacking right now. It's open to new rule suggestions and PRs. For your PRs, don't forget to commit by

npm run commit

and ensure 100% test coverage.

Currently, I am looking into validating CSS values using https://github.com/mdn/data and using the rules in https://github.com/stylelint/stylelint. Also open to suggestions and PRs in these issues.

License

MIT © Jacky Ho