From 3c46ddfdb946846c43d26ab8f98a0da3b302eebe Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Tue, 22 Sep 2020 22:47:31 -0700 Subject: [PATCH 1/4] [meta] add missing unreleased changelog entries --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f5dff5ab25..88c0b0a571 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel * [`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 +25,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 +44,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 From 0c412ef52672513cfc6fcfcf858c12ff62ed04f5 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Tue, 22 Sep 2020 22:48:09 -0700 Subject: [PATCH 2/4] Update CHANGELOG and bump version --- CHANGELOG.md | 2 ++ package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 88c0b0a571..4cdfc2d271 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel ## Unreleased +## [7.21.0] - 2020.09.22 + ### Added * [`button-has-type`]: support trivial ternary expressions ([#2748][] @Hypnosphi) * [`jsx-handler-names`]: add `checkInlineFunction` option ([#2761][] @dididy) diff --git a/package.json b/package.json index 14b94e1338..c27de4a3c0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-react", - "version": "7.20.6", + "version": "7.21.0", "author": "Yannick Croissant ", "description": "React specific linting rules for ESLint", "main": "index.js", From 67699eb79e4b0ce7c8c2b5fabcdee82cb6bbe17f Mon Sep 17 00:00:00 2001 From: Will Heslam Date: Wed, 23 Sep 2020 09:50:46 +0100 Subject: [PATCH 3/4] [Fix] `jsx-handler-names`: avoid a crash when an inline prop is not a MemberExpression Fixes #2803. Co-authored-by: Will Heslam Co-authored-by: Jordan Harband --- CHANGELOG.md | 5 +++++ lib/rules/jsx-handler-names.js | 2 +- tests/lib/rules/jsx-handler-names.js | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4cdfc2d271..b1351de3f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel ## Unreleased +### 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 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/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: '' }, { From 8edb880797209ab2c54c68da8fc5a171851c8e08 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Wed, 23 Sep 2020 15:01:36 -0700 Subject: [PATCH 4/4] Update CHANGELOG and bump version --- CHANGELOG.md | 2 ++ package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b1351de3f4..1b8b955f8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ 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) diff --git a/package.json b/package.json index c27de4a3c0..d4170ad15a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-react", - "version": "7.21.0", + "version": "7.21.1", "author": "Yannick Croissant ", "description": "React specific linting rules for ESLint", "main": "index.js",