DocumentationCommunityGitHubSlackSpectrum

Getting Started

IntroductionInstallCSSStyled ComponentsCompositionObject StylesNested SelectorsMedia QueriesGlobal Styles

Packages

emotionreact-emotionbabel-plugin-emotioneslint-plugin-emotionemotion-serveremotion-themingjest-emotion@emotion/primitivescreate-emotioncreate-emotion-styledcreate-emotion-serverpreact-emotion

eslint-plugin-emotion

Edit this page

Apply eslint rules to emotion.sh css-in-js

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/syntax-preference": [2, "string"]
  }
}

Supported Rules

Previous Page
babel-plugin-emotion