Skip to content

Error code scanner cannot see codes without a dot (PSL_*), and does not report stale codes in the reference #30434

Open

Description

@wmadden-electric

What happens

scripts/list-error-codes.mjs matches only codes of the form NAMESPACE.SUBCODE (CODE_RE). The source also emits codes without a dot: 12 of them are documented in docs/reference/error-reference.md, from PSL_BACKTICK_STRING_REQUIRES_TAG to PSL_PRESET_CONFLICT, added in #30325.

Why it matters

  • pnpm check:error-reference cannot see these codes. If one is missing from the reference, or is removed from source and stays in the reference, the check does not notice.
  • The check verifies one direction only: every code found in source must be in the reference. It does not report codes in the reference that no longer exist in source.
  • The docs site generator rejected the undotted headings, so the daily sync of the published error reference failed from 2026-09-18 until fix(docs): make the daily error reference update work again by accepting codes without a dot web#8327. The published page kept three codes that were removed in 8.0.0-rc.12 and missed 53 newer ones.

Suggested change

  • Make the scanner recognise the undotted PSL_* codes, or rename those codes to the dotted form at their source. There are 113 distinct 'PSL_*' string literals in package source, so a rename is a breaking change for anyone who matches on them.
  • Make --verify fail on a ### heading in the reference that is not a known code, and on a documented code that no longer exists in source.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions