Skip to content

Upgrading eslint-plugin-react 3 to 4

Breaking3.16.1 → 4.3.0Breaking5New11Changed4Fixed19Other4

BreakingUpgrade verdict

5 breaking changes.

  • You must now extend the recommended config to get the previous default rules, including jsx-uses-vars.
  • The rule has a new name; the old name keeps working for now but warns.
  • The jsx-quotes rule is gone; use the core ESLint rule instead.
  • The display-name rule now treats transpiler-generated names as valid; set ignoreTranspilerName to restore the previous behavior.
Top 3 of 5 that need code or config changes
Breaking5
Adds a shareable config in place of the default configuration; jsx-uses-vars is no longer enabled by default.
jsx-uses-vars
Renames jsx-sort-prop-types to sort-prop-types; the old name still works but triggers a warning.
jsx-sort-prop-typessort-prop-types
Removes the deprecated jsx-quotes rule.
jsx-quotes
display-name now accepts the transpiler name by default; use ignoreTranspilerName for the old behavior.
display-nameignoreTranspilerName
Adds static method support to sort-comp; static methods must now be declared first.
sort-comp