Skip to content
This repository was archived by the owner on Jul 15, 2023. It is now read-only.
This repository was archived by the owner on Jul 15, 2023. It is now read-only.

Incorrect RegExp in export-name rule leads to superfluously permissive #632

@IllusionMH

Description

@IllusionMH

As was discovered in #623 (comment) RegExp in export-name rule has issue with improperly escaped . as well as missing check for line start/end. These problems leads to several problems.

For class name SomeClass it allows:

  1. Wrong . escape: SomeClassButAnyTextHere.tsx, SomeClassWithoutExtension
  2. No end of line check: SomeClass.ts.or.not
  3. No start of line check: LooksLikeSomeClass.ts
  4. Everything combined NotSureThatSomeClassIsSomewhereInThis.long.filename

According to description I would expect only SomeClass.ts or at least SomeClass.suffix.tsx (but better to make it as option).

Existing test with a problem ExportNameRulePassingTestInput2.tsx ends on 2.tsx but class name doesn't have 2 et the end.

What do you think about cases above and which should be disallowed by this rule?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions