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.

react/no-typos emit false error.

See original GitHub issue

This rule fails only on external proptypes declaration. Using static class field propTypes works fine.

// validators.js
import PropTypes from 'prop-types';

export const validator = PropTypes.shape({ ... });

// Component.jsx
import { validator } from 'validators';
function Component({ value }) { ... }
Component.propTypes = {
  value: validator.isRequired,
//                ^-----------^   - Typo in declared prop type: isRequired (react/no-typos)
};

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
JustFly1984commented, Mar 24, 2018

I use immutable.js extensively accross my apps. I get errors on ImmutablePropTypes.map and ImmutablePropTypes.list

Typo in declared prop type: map  react/no-typos
Typo in declared prop type: list  react/no-typos

Please help. Currently it breaks my build, so I will mute this rule until you fix it

0reactions
alexzherdevcommented, Jun 12, 2018

I’ve looked into this, but I’m unable to reproduce with the following test case (which produces no errors):

import { validator } from 'validators';
function MyComponent(props) { return (<div>{props.myProp}</div>) }
MyComponent.propTypes = {
  myProp: validator.isRequired
};
Read more comments on GitHub >

github_iconTop Results From Across the Web

react/no-typos emit false error. · Issue #1738 - GitHub
This rule fails only on external proptypes declaration. Using static class field propTypes works fine. // validators.js import PropTypes ...
Read more >
Get strange React propTypes error even it works in another ...
Line 282:20: Typo in declared prop type: boolean react/no-typos. Search for the keywords to learn more about each error.
Read more >
Error Boundaries - React
Error boundaries catch errors during rendering, in lifecycle methods, and in constructors of the whole tree below them.
Read more >
Render Sub-component Error in React.js using Error Boundaries
Error boundaries are normal React components that act as a wrapper to catch the errors from the child components. A component can simply...
Read more >
API Reference - Formik
Form validation errors. Should match the shape of your form's values defined in initialValues . If you are using validationSchema (which you should...
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