ESLint plugin for react-with-styles, version 2.4.0. Provides linting rules to enforce best practices for the react-with-styles library, which enables theming and CSS-in-JS with fallbacks to Aphrodite or other backends. This plugin includes two rules: no-unused-styles ensures all defined styles are referenced in the component, and only-spread-css prevents mixing css() spreads with className or style props. Release cadence is low; last update was in 2018. Differentiators: specifically tailored for react-with-styles rather than generic CSS-in-JS linting. Supports ESLint versions 2 through 8.
npm install eslint-plugin-react-with-stylesVerified import paths — ran on the pinned version, not inferred.
Configures ESLint to use the react-with-styles plugin with both rules enabled.
Consider migrating to a more modern CSS-in-JS linting solution like eslint-plugin-styled-components or eslint-plugin-emotion.
Use the provided css() function from react-with-styles and do not create custom wrappers.
Ensure ESLint version is between 2 and 8; consider pinning ESLint to a supported version.
Run: npm install eslint-plugin-react-with-styles --save-dev
Ensure plugins array includes 'react-with-styles' and rule is spelled exactly 'react-with-styles/no-unused-styles'.
Convert to flat config or use .eslintrc with 'extends' or 'plugins' as expected by legacy config.