Skip to content

no-unused-prop-types: change reported node to property key #2287

Closed
@golopot

Description

@golopot

The rule no-unused-prop-types currently reports the property value of the unused propType. I think it is more appropriate to report the property key.

// current behavior
Foo.propTypes = {
  neverUsed: PropType.number,
//           ~~~~~~~~~~~~~~~
// PropType is defined but never used. 
}

// proposed behavior
Foo.propTypes = {
  neverUsed: PropType.number,
//~~~~~~~~~
// PropType is defined but never used. 
}

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