Skip to content

Commit

Permalink
[Docs] no-unused-prop-types: fix syntax errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdulin authored and ljharb committed Mar 29, 2022
1 parent 8513f1a commit b9b1bee
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions docs/rules/no-unused-prop-types.md
Expand Up @@ -15,18 +15,18 @@ class Hello extends React.Component {
render() {
return <div>Hello Bob</div>;
}
});
}

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<Props> {
Expand Down Expand Up @@ -62,11 +62,11 @@ class Hello extends React.Component {
render() {
return <div>Hello {this.props.name}</div>;
}
};
}

Hello.propTypes: {
Hello.propTypes = {
name: PropTypes.string
},
};
```

## Rule Options
Expand Down

0 comments on commit b9b1bee

Please sign in to comment.