Skip to content

[purity] Expand IMPURE_FUNCS / IMPURE_CTORS catalog to cover more built-ins #1761

@Rel1cx

Description

@Rel1cx

Background

The current purity rule relies on explicit IMPURE_FUNCS / IMPURE_CTORS deny-lists, while React Compiler infers impurity automatically via effect inference. This can lead to false negatives for built-ins not yet catalogued.

Examples of potentially missing built-ins

  • performance.now() (mentioned in the SPEC as a built-in inferred with Impure effect)
  • Other environment-specific impure APIs not yet catalogued

Expected behavior

Systematically audit and add common impure built-in functions / constructors to the catalog.

References

  • Diff report: plugins/eslint-plugin-react-x/src/rules/purity/purity.spec.diff.md (§4)
  • Related files: catalog definitions in the rule implementation / shared constants

Priority

P1 — low implementation cost (list maintenance), steadily improves coverage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: compilerReact Compiler SPEC alignmentpriority: highMajor impact; schedule next releasestatus: triageNeeds initial review / classificationtype: featureNew feature or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions