Upgrading eslint-plugin-react 6 to 7
Breaking6.10.3 → 7.37.5Breaking23Platform3Deprecated2New176Changed67Fixed503Other199
BreakingUpgrade verdict
15 breaking changes and 3 platform requirement changes.
In plain terms
- 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.
Must act 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).
What you must change
Breaking15
Removes the deprecated
wrap-multilines rule in favor of jsx-wrap-multilines.wrap-multilinesjsx-wrap-multilinesRemoves the deprecated
no-comment-textnodes rule in favor of jsx-no-comment-textnodes.no-comment-textnodesjsx-no-comment-textnodesRemoves the deprecated
require-extension rule in favor of eslint-plugin-import's extensions rule.require-extensionextensionsChanges the
jsx-first-prop-new-line default to multiline-multiprop.jsx-first-prop-new-linemultiline-multipropjsx-no-undef no longer checks the global scope by default; use allowGlobals to restore it.jsx-no-undefallowGlobalsAdds
no-danger-with-children to the recommended rules.no-danger-with-childrenAdds
no-string-refs to the recommended rules.no-string-refsAdds warnings for
React.PropTypes and React.createClass in no-deprecated for React 15.5.0.no-deprecatedReact.PropTypesReact.createClassAdds
jsx-key to the recommended rules.jsx-keyUpdates the
createClass component factory to createReactClass for component detection.createClasscreateReactClassAdds
jsx-no-comment-textnodes to the recommended rules.jsx-no-comment-textnodesAdds
jsx-no-target-blank to the recommended rules.jsx-no-target-blankAdds
no-unescaped-entities to the recommended rules.no-unescaped-entitiesAdds
no-children-prop to the recommended rules.no-children-propjsx-wrap-multilines now checks arrow functions without a block body.jsx-wrap-multilinesPlatform3
Adds ESLint 6.0.0 as a valid peerDependency.
Sets ESLint 4.0.0 as a valid peerDependency.
peerDependencyDrops support for Node.js versions below 4.
Deprecations to plan for
Deprecated2
no-deprecated now flags cWM, cWRP and cWU lifecycle methods since React 16.9.0.
no-deprecatedcomponentWillMountcomponentWillReceivePropscomponentWillUpdateDeprecates
jsx-space-before-closing in favor of jsx-tag-spacing; it still works but warns.jsx-space-before-closingjsx-tag-spacing