Skip to content

Upgrading eslint-plugin-react 6 to 7

Breaking6.10.3 → 7.37.5Breaking23Platform3Deprecated2New176Changed67Fixed503Other199

BreakingUpgrade verdict

15 breaking changes and 3 platform requirement changes.

  • The old wrap-multilines rule is gone; use jsx-wrap-multilines instead.
  • The old no-comment-textnodes rule is gone; use jsx-no-comment-textnodes instead.
  • The require-extension rule is gone; use the extensions rule from eslint-plugin-import instead.
  • The default behavior for where the first prop goes now requires a new line only for multiline elements with multiple props.
Top 5 of 20 that need code or config changes

Node.js requirement changed in 7.0.0-rc.1: >=0.10 → >=4.

Adds array-includes ^3.1.8, array.prototype.findlast ^1.2.5, array.prototype.flatmap ^1.3.3, array.prototype.tosorted ^1.1.4, es-iterator-helpers ^1.2.1, estraverse ^5.3.0, hasown ^2.0.2, minimatch ^3.1.2, object.entries ^1.1.9, object.fromentries ^2.0.8, object.values ^1.2.1, prop-types ^15.8.1, resolve ^2.0.0-next.5, semver ^6.3.1, string.prototype.matchall ^4.0.12, string.prototype.repeat ^1.0.0.

Drops array.prototype.find, has, object.assign.

Installs 124 packages in all (was 99).

Breaking15
Removes the deprecated wrap-multilines rule in favor of jsx-wrap-multilines.
wrap-multilinesjsx-wrap-multilines
Removes the deprecated no-comment-textnodes rule in favor of jsx-no-comment-textnodes.
no-comment-textnodesjsx-no-comment-textnodes
Removes the deprecated require-extension rule in favor of eslint-plugin-import's extensions rule.
require-extensionextensions
Changes the jsx-first-prop-new-line default to multiline-multiprop.
jsx-first-prop-new-linemultiline-multiprop
jsx-no-undef no longer checks the global scope by default; use allowGlobals to restore it.
jsx-no-undefallowGlobals
Adds no-danger-with-children to the recommended rules.
no-danger-with-children
Adds no-string-refs to the recommended rules.
no-string-refs
Adds warnings for React.PropTypes and React.createClass in no-deprecated for React 15.5.0.
no-deprecatedReact.PropTypesReact.createClass
Adds jsx-key to the recommended rules.
jsx-key
Updates the createClass component factory to createReactClass for component detection.
createClasscreateReactClass
Adds jsx-no-comment-textnodes to the recommended rules.
jsx-no-comment-textnodes
Adds jsx-no-target-blank to the recommended rules.
jsx-no-target-blank
Adds no-unescaped-entities to the recommended rules.
no-unescaped-entities
Adds no-children-prop to the recommended rules.
no-children-prop
jsx-wrap-multilines now checks arrow functions without a block body.
jsx-wrap-multilines
Platform3
Adds ESLint 6.0.0 as a valid peerDependency.
Sets ESLint 4.0.0 as a valid peerDependency.
peerDependency
Drops support for Node.js versions below 4.
Deprecated2
no-deprecated now flags cWM, cWRP and cWU lifecycle methods since React 16.9.0.
no-deprecatedcomponentWillMountcomponentWillReceivePropscomponentWillUpdate
Deprecates jsx-space-before-closing in favor of jsx-tag-spacing; it still works but warns.
jsx-space-before-closingjsx-tag-spacing