Skip to content

Parser disables react/no-unused-prop-types #16

Closed
@JamesHenry

Description

@JamesHenry

This issue was initially reported here: eslint/typescript-eslint-parser#502


What version of TypeScript are you using?
2.9.2

What version of typescript-eslint-parser are you using?
16.0.1. Here are the other versions:

"eslint-config-airbnb": "17.0.0",
    "eslint-config-prettier": "2.9.0",
    "eslint-plugin-babel": "5.1.0",
    "eslint-plugin-import": "2.13.0",
    "eslint-plugin-jest": "21.15.0",
    "eslint-plugin-jsx-a11y": "6.1.1",
    "eslint-plugin-prettier": "2.6.2",
    "eslint-plugin-promise": "3.8.0",
    "eslint-plugin-react": "7.10.0",
    "eslint-plugin-typescript": "0.12.0",

What code were you trying to parse?

import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
import { ChapterShape, VerseShape } from '../../shapes';
import VerseContainer from '../../containers/VerseContainer';

const propTypes = {
  chapter: ChapterShape.isRequired,
  isEndOfSurah: PropTypes.bool.isRequired,
  currentVerse: PropTypes.string,
  isLoading: PropTypes.bool.isRequired,
  isSingleVerse: PropTypes.bool.isRequired,
  verses: PropTypes.objectOf(VerseShape),
  extra: PropTypes.bool.isRequired,
};

type Props = {
  chapter: ChapterShape;
  verses: { [verseKey: string]: VerseShape };
};

const ListView: React.SFC<Props> = ({ chapter, verses }: Props) => (
  <Fragment>
    {Object.values(verses).map((verse: VerseShape) => (
      <VerseContainer
        verse={verse}
        chapter={chapter}
        key={`${verse.chapterId}-${verse.id}-verse`}
      />
    ))}
  </Fragment>
);

ListView.propTypes = propTypes;

export default ListView;

What did you expect to happen?
I should get error for extra as 'extra' PropType is defined but prop is never used. This only works when I don't use typescript-eslint-parser.

What happened?

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions