Skip to content

sort-comp wrong order with RegExp rules and static methods #1821

Closed
@nosilleg

Description

@nosilleg

I believe this issues comes from #1795

The Airbnb rules for react include sort-comp with regex matching. source here

If you have a static method that matches any of the 3 RegExp values (e.g. renderCell) then this will push to indexes, and the following check for method.static will not happen because of the new conditional on empty indexes.

This should be valid according to the Airbnb Rules.

class Row extends React.Component {
  static getDelta(data) {
    ...
  }

  static onTimeout() {
    ...
  }

  static renderCell(data) {
    ...
  }

  constructor(props) {
    ...
  }

  render() {
    ...
  }
}

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