Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no-typos doesn't detect invalid PropTypes in static class fields #1677

Closed
swrobel opened this issue Feb 4, 2018 · 0 comments
Closed

no-typos doesn't detect invalid PropTypes in static class fields #1677

swrobel opened this issue Feb 4, 2018 · 0 comments

Comments

@swrobel
Copy link

swrobel commented Feb 4, 2018

I've observed this with versions 7.5.1 & 7.6.1. The docs indicate that the following should cause this warning: Typo in declared prop type: typo however it doesn't.

class MyComponent extends React.Component {
  static propTypes = {
    a: PropTypes.typo
  }
}

However, when you don't use static class fields, it produces the expected warning:

class MyComponent extends React.Component {}
MyComponent.propTypes = {
  a: PropTypes.typo
};
alexzherdev added a commit to alexzherdev/eslint-plugin-react that referenced this issue Jun 14, 2018
calebeby pushed a commit to Pigmice2733/scouting-frontend that referenced this issue Jun 30, 2018
This Pull Request updates dependency [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) from `v7.9.1` to `v7.10.0`



<details>
<summary>Release Notes</summary>

### [`v7.10.0`](https://github.com/yannickcr/eslint-plugin-react/blob/master/CHANGELOG.md#&#8203;7100---2018-06-24)
[Compare Source](jsx-eslint/eslint-plugin-react@v7.9.1...v7.10.0)
##### Added
* Allow eslint ^5 ([#&#8203;1843][] @&#8203;papandreou, @&#8203;ljharb)
* [`no-unsafe`][] rule ([#&#8203;1831][], [#&#8203;1830][] @&#8203;sergei-startsev)
* [`no-will-update-set-state`][]: Account for `UNSAFE_` methods ([#&#8203;1845][], [#&#8203;1844][] @&#8203;alexzherdev)
##### Fixed
* [`no-typos`][]: Fix static propTypes handling ([#&#8203;1827][], [#&#8203;1677][] @&#8203;alexzherdev)
* [`destructuring-assignment`][]: Allow LHS ([#&#8203;1825][], [#&#8203;1728][] @&#8203;alexzherdev)
* [`no-unused-prop-types`][]: Fix crash when encountering mixed union and intersection flow types ([#&#8203;1806][] @&#8203;yannickcr)
##### Changed
* Typo fixes in [`jsx-no-target-blank`][] ([#&#8203;1805][] @&#8203;ferhatelmas))

[#&#8203;1845]: `jsx-eslint/eslint-plugin-react#1845
[#&#8203;1844]: `jsx-eslint/eslint-plugin-react#1844
[#&#8203;1843]: `jsx-eslint/eslint-plugin-react#1843
[#&#8203;1831]: `jsx-eslint/eslint-plugin-react#1831
[#&#8203;1830]: `jsx-eslint/eslint-plugin-react#1830
[#&#8203;1827]: `jsx-eslint/eslint-plugin-react#1827
[#&#8203;1825]: `jsx-eslint/eslint-plugin-react#1825
[#&#8203;1806]: `jsx-eslint/eslint-plugin-react#1806
[#&#8203;1805]: `jsx-eslint/eslint-plugin-react#1805
[#&#8203;1728]: `jsx-eslint/eslint-plugin-react#1728
[#&#8203;1677]: `jsx-eslint/eslint-plugin-react#1677

---

</details>




---

This PR has been generated by [Renovate Bot](https://renovatebot.com).
This was referenced Sep 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants