Today's Trends
minorInvestigatingBun

Bun Lint Reports False prefer-readonly-parameter-types Findings Based on File Sharing

  1. Investigating(current)
  2. Trending(upcoming)
  3. Workaround available(upcoming)
  4. Resolved(upcoming)

Executive summary

Bun lint with typeAware = true produces inconsistent findings on the same code tree depending on which files share a checker. This causes false @typescript-eslint/prefer-readonly-parameter-types findings due to cached synthesized properties.

No verified workaround yet

None of the linked reports describe a mitigation. Follow this incident to hear when one appears.

Official fix
Technical root cause

get_undefined_property in src/sema/check/symbols.rs caches 1 synthesized property per name on the checker, retaining the READONLY flag of the first property that requested it.

Evidence

1 report · 1 GitHubShow
  1. [1]
    GitHub First report
    bun lint reports a false prefer-readonly-parameter-types finding that depends on which files share a checker(opens GitHub issue in a new tab)

    What happens bun lint with typeAware = true gives different findings on the same tree and the same flags. The extra finding is @typescript-eslint/prefer-readonly-parameter-types on the callback of an as const table whose rows have different property sets. get_undefined_property in src/sema/check/symbols.rs caches 1 synthesized property per name on the checker. The entry keeps the READONLY flag of the first property that asked for it. A mutable row earlier on the same checker therefore gives a…

    by burak-bayir 0upvotes 0comments

Timeline

  1. First report on GitHub issue

    bun lint reports a false prefer-readonly-parameter-types finding that depends on which files share a checker

    Source