Skip to content

Lexicon contract: three members have zero adopters; rulePrefix is declared but unchecked #1349

Closed

Description

@lex00

Part of the lexicon contract epic (#1340).

The defect

Three LexiconPlugin members have zero implementations across all twelve lexicons:

Member Adopters Advertised in docs
declarativeRules?(): RuleSpec[] 0 yes — lexicon-authoring/overview.mdx optional-methods table
init?(): void | Promise<void> 0 no
codeActionProvider?(ctx): CodeAction[] 0 no

declarativeRules is the awkward one: it is presented to authors as a supported way to write lint rules ("Declarative lint rules (compiled via rule())") and no shipped lexicon has ever used it. An author who follows the table gets an untrodden path.

Related: Serializer.rulePrefix is declared on every serializer and checked by nothing. k8s declares WK8 and also ships five ARGO0xx rules outside its own prefix, which is exactly the sort of thing a prefix declaration exists to prevent — forgejo wraps github's rules as WFJ-GHA0xx specifically to avoid an id collision, by convention rather than by rule.

Into the contract

For each of the three: implement it somewhere real, or remove it and the docs that advertise it. A contract member with no adopter is a claim about supported surface that no test exercises and no reviewer can evaluate.

rulePrefix gets a check: every rule and post-synth id a lexicon contributes starts with its declared prefix, with the cross-cutting core ids (COR*, EXT*) exempt. Resolve k8s's ARGO0xx under whatever that check decides.

Done when

  • No LexiconPlugin member is advertised without an adopter
  • Rule ids are verified against the declared prefix
  • k8s's ARGO ids are either in-prefix or explicitly exempt

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