From b9b1bee5a27b4c3d2b970bbdc5345db4a870b48f Mon Sep 17 00:00:00 2001 From: mrdulin Date: Tue, 29 Mar 2022 17:59:07 +0800 Subject: [PATCH] [Docs] `no-unused-prop-types`: fix syntax errors --- CHANGELOG.md | 2 ++ docs/rules/no-unused-prop-types.md | 16 ++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 77332e041d..82397550fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,9 +17,11 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange ### Changed * [readme] remove global usage and eslint version from readme ([#3254][] @aladdin-add) * [Refactor] fix linter errors ([#3261][] @golopot) +* [Docs] [`no-unused-prop-types`]: fix syntax errors ([#3259][] @mrdulin) [#3261]: https://github.com/yannickcr/eslint-plugin-react/pull/3261 [#3260]: https://github.com/yannickcr/eslint-plugin-react/pull/3260 +[#3259]: https://github.com/yannickcr/eslint-plugin-react/pull/3259 [#3254]: https://github.com/yannickcr/eslint-plugin-react/pull/3254 [#3251]: https://github.com/yannickcr/eslint-plugin-react/pull/3251 [#3244]: https://github.com/yannickcr/eslint-plugin-react/pull/3244 diff --git a/docs/rules/no-unused-prop-types.md b/docs/rules/no-unused-prop-types.md index 6ca79d46cc..2641ddfda1 100644 --- a/docs/rules/no-unused-prop-types.md +++ b/docs/rules/no-unused-prop-types.md @@ -15,18 +15,18 @@ class Hello extends React.Component { render() { return
Hello Bob
; } -}); +} Hello.propTypes = { name: PropTypes.string -}, +}; ``` ```jsx type Props = { - firstname: string, - middlename: string, // middlename is never used by the Hello component - lastname: string + firstname: string; + middlename: string; // middlename is never used by the Hello component + lastname: string; } class Hello extends React.Component { @@ -62,11 +62,11 @@ class Hello extends React.Component { render() { return
Hello {this.props.name}
; } -}; +} -Hello.propTypes: { +Hello.propTypes = { name: PropTypes.string -}, +}; ``` ## Rule Options