# @emotion/eslint-plugin

> ESLint rules for emotion

Latest version **11.12.0** (published 2024-07-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install @emotion/eslint-plugin
pnpm add @emotion/eslint-plugin
yarn add @emotion/eslint-plugin
bun add @emotion/eslint-plugin
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high maintenance score; popular repo.

Warnings: low downloads.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 11.12.0 |
| Published | 2024-07-19 |
| First published | 2020-01-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=6 |
| Dependencies | 1 |
| Unpacked size | 121.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 18019 |
| Author | alex-pex |
| Maintainers | emmatown, tkh44, emotion-release-bot, andarist |
| Keywords | eslint, eslintplugin, eslint-plugin, emotion |

## Links

- npm: https://www.npmjs.com/package/@emotion/eslint-plugin
- Repository: https://github.com/emotion-js/emotion.git#main
- Homepage: https://github.com/emotion-js/emotion/tree/main#readme
- Issues: https://github.com/emotion-js/emotion/issues
- npm.io page: https://npm.io/package/@emotion/eslint-plugin

## Dependencies (1)

- [@typescript-eslint/utils](https://npm.io/package/@typescript-eslint/utils.md) ^5.25.0

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@inrupt/eslint-config-base](https://npm.io/package/@inrupt/eslint-config-base.md) — 4.5K weekly downloads

## Recent versions

- 11.12.0 (latest) — 2024-07-19
- 11.0.0-rc.0 (rc) — 2020-10-11
- 11.0.0-next.10 (next) — 2020-01-05
- 11.11.0 — 2023-05-06
- 11.10.0 — 2022-07-31
- 11.7.0 — 2021-11-26
- 11.5.0 — 2021-10-17
- 11.2.0 — 2021-02-09
- 11.0.0 — 2020-11-12

## README

# @emotion/eslint-plugin

> ESLint rules for emotion

## Installation

You'll first need to install [ESLint](http://eslint.org):

```
$ npm i eslint --save-dev
```

Next, install `@emotion/eslint-plugin`:

```
$ npm install @emotion/eslint-plugin --save-dev
```

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

## Usage

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

```json
{
  "plugins": ["@emotion"]
}
```

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

```json
{
  "rules": {
    "@emotion/jsx-import": "error"
  }
}
```

## Emotion 11 codemod

The Emotion 11 codemods are contained in this package. To use them, enable the rule shown below.

```json
{
  "rules": {
    "@emotion/pkg-renaming": "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/react` 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.

```json
{
  "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

- [jsx-import](https://github.com/emotion-js/emotion/blob/main/packages/eslint-plugin/docs/rules/jsx-import.md)
- [styled-import](https://github.com/emotion-js/emotion/blob/main/packages/eslint-plugin/docs/rules/styled-import.md)
- [import-from-emotion](https://github.com/emotion-js/emotion/blob/main/packages/eslint-plugin/docs/rules/import-from-emotion.md)
- [no-vanilla](https://github.com/emotion-js/emotion/blob/main/packages/eslint-plugin/docs/rules/no-vanilla.md)
- [syntax-preference](https://github.com/emotion-js/emotion/blob/main/packages/eslint-plugin/docs/rules/syntax-preference.md)

---
_Source: https://npm.io/package/@emotion/eslint-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
