question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

no-unused-prop-types doesn't support Props defined in Flow TypedArguments

See original GitHub issue

This 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:closed
  • Created 6 years ago
  • Reactions:7
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jseminckcommented, Aug 27, 2017

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!

0reactions
ljharbcommented, Feb 4, 2022

This seems all fixed.

If not, please file a new issue.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found