Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-emotion

Package Overview
Dependencies
Maintainers
2
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-emotion

ESLint rules for emotion

  • 10.0.0-beta.11
  • npm
  • Socket score

Version published
Weekly downloads
20K
decreased by-1.29%
Maintainers
2
Weekly downloads
 
Created
Source

eslint-plugin-emotion

ESLint rules for emotion

Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install eslint-plugin-emotion:

$ npm install eslint-plugin-emotion --save-dev

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

Usage

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

{
  "plugins": ["emotion"]
}

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

{
  "rules": {
    "emotion/jsx": "error"
  }
}

Emotion 10 codemods

The Emotion 10 codemods are contained in this package. To use them, enable the rules shown below. Keeping these rules after migrating is also useful to have jsx from @emotion/core automatically imported when the css prop is used and other such things. You may also want to not enable certain rules while you are migrating or forever, such the no-vanilla rule.

{
  "rules": {
    "emotion/jsx-import": "error",
    "emotion/no-vanilla": "error",
    "emotion/import-from-emotion": "error",
    "emotion/styled-import": "error"
  }
}

Note:

These rules assume you are using React, if you are not using React, you should keep using the emotion package.

Supported Rules

Keywords

FAQs

Package last updated on 12 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc