no-unused-prop-types doesn't support Props defined in Flow TypedArguments
See original GitHub issueThis syntax is not supported. Additionally, this code is already available for the prop-types
rule, but we should extract this code to detect the existing prop-types to some shared utility so it can be shared between rules.
// Flow <0.53
class extends React.Component<DefaultProps, Props, State> {}
class extends React.Component<DefaultProps, Props, State> { props: Props; }
// Flow >=0.53
class extends React.Component<Props> {}
class extends React.Component<Props, State> {}
class extends React.Component { props: Props; }
class extends React.Component<Props> { props: Props; }
class extends React.Component<Props, State> { props: Props; }
Issue Analytics
- State:
- Created 6 years ago
- Reactions:7
- Comments:8 (5 by maintainers)
Top Results From Across the Web
eslint-plugin-react/no-unused-prop-types.md at master - GitHub
Disallow definitions of unused propTypes ( react/no-unused-prop-types ) Warns if a prop with a defined type isn't being used. Note: You can provide...
Read more >react/prop-types eslint error in typescript react component
I tried explicitly setting children and onClick like this: Button. propTypes = { children?: React. ReactNode, onClick?: (e: any) => void };
Read more >Comparing TypeScript and PropTypes in React applications
Compare TypeScript and PropTypes, tools for type checking, to determine which one best suits your project's needs.
Read more >eslint-plugin-coffee - npm
ESLint is the preeminent linter in the JavaScript world. As of CoffeeScript v2.5.0, the CoffeeScript compiler exposes an Abstract Syntax Tree (AST) ...
Read more >node_modules/eslint-plugin-react/CHANGELOG.md · master ...
no -unused-prop-types : Silence false positive on never type in TS (#2815 ... propTypes detection): do not crash on empty flow type spreads...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
FYI I’m working on this: https://github.com/jseminck/eslint-plugin-react/tree/prop-types-util - just to make sure we don’t do double work!
This seems all fixed.
If not, please file a new issue.