Skip to content

[finding] Two publish-time rules give an author contradictory fixes for the same bare unquoted word — visibility-bare-identifier (error) says data.active, predicate-rhs-path-shaped (warning) says 'active' #7696

Description

@os-help

Surfaced by the dev implementing #7659 (PR #7691), disclosed in that PR's body rather than papered over, and pinned in runtime-gate.test.ts so the interaction is recorded in the suite rather than only in prose. Filed separately because reconciling two rules' messages is not a rider on the PR that introduced one of them.

Filed unassigned, observation class. ⛔ Grading is the triage seat's single channel.

The fact

For one token — a bare unquoted word on the right of ==, e.g. status == active — two publish-time rules both fire, and they prescribe different fixes:

rule severity reads the token as prescribes
visibility-bare-identifier error a dropped binding root data.active
predicate-rhs-path-shaped (#7659, PR #7691) warning a literal missing its quotes 'active'

Both statements are true about the token. They are not true about the same intent, and nothing in either message tells the author which intent the linter thinks they had — because neither rule can know.

Why this is worth a card rather than a shrug

The two fixes are not merely different, they are semantically opposite: one turns the token into a path lookup, the other into a string literal. An author following the error (which is louder, and blocks) when they meant a literal gets a predicate that compares against data.active — a path that probably does not resolve, so #7214's predicate-path-unresolved then fires and the author is walked around a triangle.

⚠️ Note also that the bare-word spelling works today by accident — that is exactly why #7659 landed it as warning rather than error, per objectui#4049's ruling ("it would flip data.type == text, the unquoted-string spelling that works today by accident, into a fail-open true"). So the author is being told, at error severity, to change something that currently works, in a direction that may break it.

What is NOT being claimed

Shapes a fix could take (none obviously right — hence a finding)

  1. Suppress one when the other fires. Cheapest. Requires deciding which reading wins for a bare word on an RHS, which is the actual open question.
  2. Merge the two messages for this one position — a single finding naming both spellings and letting the author choose. Keeps both diagnoses, costs a special case in two rules.
  3. Accept it and make the messages cross-reference each other, so an author seeing both is told they are two readings of one ambiguity rather than two independent errors.
  4. Accept as-is. Defensible: both fire, the author reads both, and the pin stops it drifting. Weakest, because the error is the one that blocks and it is the one asserting the less likely intent for an RHS position.

Pointers

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions