Content-Length: 283062 | pFad | https://redirect.github.com/jsx-eslint/eslint-plugin-react/issues/1607

83 `no-typos`: false positive · Issue #1607 · jsx-eslint/eslint-plugin-react · GitHub
Skip to content

no-typos: false positive #1607

@ljharb

Description

@ljharb

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: https://redirect.github.com/jsx-eslint/eslint-plugin-react/issues/1607

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy