diff --git a/CHANGELOG.md b/CHANGELOG.md index f5dff5ab25..1b8b955f8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,10 +5,21 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel ## Unreleased +## [7.21.1] - 2020.09.23 + +### Fixed +* [`jsx-handler-names`]: avoid a crash when an inline prop is not a MemberExpression ([#2803][] @willheslam) + +[#2803]: https://github.com/yannickcr/eslint-plugin-react/issues/2803 + +## [7.21.0] - 2020.09.22 + ### Added * [`button-has-type`]: support trivial ternary expressions ([#2748][] @Hypnosphi) * [`jsx-handler-names`]: add `checkInlineFunction` option ([#2761][] @dididy) * [`jsx-no-literals`]: add `noAttributeStrings` option ([#2782][] @TaLeaMonet) +* [`prop-types`]: add support for `PropTypes.exact` ([#2740][] @jzabala) +* [`jsx-filename-extension`]: Add allow option ([#2746][] @remcohaszing) ### Fixed * [`function-component-definition`]: ignore object properties ([#2771][] @stefan-wullems) @@ -23,9 +34,13 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel * [`jsx-props-no-multi-spaces`]: "Expected no line gap between" false positive ([#2792][] @karolina-benitez) * [`no-unknown-property`]: check attributes with any input case ([#2790][] @julienw) * [`prop-types`]/[`no-unused-prop-types`]: handle CallExpression in ReturnType ([#2802][] @hank121314) +* [`jsx-uses-react`]: mark fragment variables as used ([#2775][] @remcohaszing) +* [`no-unused-prop-types`]: improve component declared props detection ([#2755][] @jzabala) +* [`jsx-props-no-multi-spaces`]: Show error in multi-line props ([#2756][] @iiison) ### Changed * [Tests] [`jsx-one-expression-per-line`]: add passing tests ([#2799][] @TaLeaMonet) +* [Tests] [`prop-types`]: add test ([#2757][] @jzabala) [#2802]: https://github.com/yannickcr/eslint-plugin-react/pull/2802 [#2801]: https://github.com/yannickcr/eslint-plugin-react/pull/2801 @@ -38,12 +53,17 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel [#2782]: https://github.com/yannickcr/eslint-plugin-react/pull/2782 [#2780]: https://github.com/yannickcr/eslint-plugin-react/pull/2780 [#2779]: https://github.com/yannickcr/eslint-plugin-react/pull/2779 +[#2775]: https://github.com/yannickcr/eslint-plugin-react/pull/2775 [#2772]: https://github.com/yannickcr/eslint-plugin-react/pull/2772 [#2771]: https://github.com/yannickcr/eslint-plugin-react/pull/2771 [#2770]: https://github.com/yannickcr/eslint-plugin-react/pull/2770 [#2767]: https://github.com/yannickcr/eslint-plugin-react/pull/2767 [#2761]: https://github.com/yannickcr/eslint-plugin-react/pull/2761 +[#2757]: https://github.com/yannickcr/eslint-plugin-react/pull/2757 +[#2756]: https://github.com/yannickcr/eslint-plugin-react/pull/2756 [#2748]: https://github.com/yannickcr/eslint-plugin-react/pull/2748 +[#2746]: https://github.com/yannickcr/eslint-plugin-react/pull/2746 +[#2740]: https://github.com/yannickcr/eslint-plugin-react/pull/2740 [#1689]: https://github.com/yannickcr/eslint-plugin-react/pull/1689 ## [7.20.6] - 2020.08.12 diff --git a/lib/rules/jsx-handler-names.js b/lib/rules/jsx-handler-names.js index c97811994d..e813ea66ef 100644 --- a/lib/rules/jsx-handler-names.js +++ b/lib/rules/jsx-handler-names.js @@ -109,7 +109,7 @@ module.exports = { || ( !checkLocal && (isInlineHandler(node) - ? !node.value.expression.body.callee.object + ? !node.value.expression.body.callee || !node.value.expression.body.callee.object : !node.value.expression.object ) ) diff --git a/package.json b/package.json index 14b94e1338..d4170ad15a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-react", - "version": "7.20.6", + "version": "7.21.1", "author": "Yannick Croissant ", "description": "React specific linting rules for ESLint", "main": "index.js", diff --git a/tests/lib/rules/jsx-handler-names.js b/tests/lib/rules/jsx-handler-names.js index 1c452b78c6..eb65e50389 100644 --- a/tests/lib/rules/jsx-handler-names.js +++ b/tests/lib/rules/jsx-handler-names.js @@ -70,6 +70,8 @@ ruleTester.run('jsx-handler-names', rule, { options: [{ checkInlineFunction: true }] + }, { + code: ' 42} />' }, { code: '' }, {