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: false positive #1607

Closed
ljharb opened this issue Dec 14, 2017 · 0 comments · Fixed by #1652
Closed

no-typos: false positive #1607

ljharb opened this issue Dec 14, 2017 · 0 comments · Fixed by #1652

Comments

@ljharb
Copy link
Member

ljharb commented Dec 14, 2017

Here's the code:

import React from 'react';
import PropTypes from 'prop-types';
import { forbidExtraProps } from 'airbnb-prop-types';

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

export default function withWrapper(Component) {
  class Wrapper extends React.Component {
  }

  Wrapper.propTypes = forbidExtraProps({
    ...Component.propTypes,
    phrases: CustomShape.isRequired,
  });

  Wrapper.childContextTypes = {
    ...Component.contextTypes,
    phrases: CustomShape.isRequired,
  };

  Wrapper.displayName = `withWrapper(${Component.displayName || Component.name})`;

  return Wrapper;
}

The error:

Typo in declared prop type: isRequired  react/no-typos

This shouldn't error, both because it's not a typo, and because PhraseShape isn't a component.

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

Successfully merging a pull request may close this issue.

1 participant