Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
hank121314 committed Sep 24, 2020
2 parents 49e264a + 8edb880 commit 1765331
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG.md
Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/jsx-handler-names.js
Expand Up @@ -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
)
)
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "eslint-plugin-react",
"version": "7.20.6",
"version": "7.21.1",
"author": "Yannick Croissant <yannick.croissant+npm@gmail.com>",
"description": "React specific linting rules for ESLint",
"main": "index.js",
Expand Down
2 changes: 2 additions & 0 deletions tests/lib/rules/jsx-handler-names.js
Expand Up @@ -70,6 +70,8 @@ ruleTester.run('jsx-handler-names', rule, {
options: [{
checkInlineFunction: true
}]
}, {
code: '<TestComponent onChange={() => 42} />'
}, {
code: '<TestComponent onChange={this.props.onFoo} />'
}, {
Expand Down

0 comments on commit 1765331

Please sign in to comment.