An ESLint plugin providing linting rules specific to Emotion, a popular CSS-in-JS library. Version 11.0.0 targets Emotion v11 and includes rules like 'no-vanilla', 'import-from-emotion', 'styled-import', 'syntax-preference', and 'no-invalid-styled-component'. This plugin helps enforce best practices and catch common mistakes in Emotion code. It has a stable release cadence, though updates align with Emotion major versions. Key differentiators: it is the official linting tool for Emotion, replacing generic CSS-in-JS linting with Emotion-specific rules. Requires ESLint and Emotion as peer dependencies.
npm install eslint-plugin-emotionVerified import paths — ran on the pinned version, not inferred.
Configures ESLint to lint Emotion code using the plugin and recommended rules.
Upgrade to Emotion v11 or use eslint-plugin-emotion@10 for Emotion v10.
Remove 'no-vanilla' and use '@emotion/no-vanilla' or update to Emotion v11 naming conventions.
Ensure 'emotion' is listed in the plugins array and not just in rules.
Add 'parser: @typescript-eslint/parser' and check rule compatibility.
Run `npm install eslint-plugin-emotion --save-dev`.
Check plugin version; for v11, use '@emotion/no-vanilla' or update rules.
Remove 'emotion' property and use 'plugins: ["emotion"]' and rules under 'emotion/rule-name'.