oracle-gaps: the owns refusal should name the fix (shared const, as const, spreads)

Offen
#69 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
30/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
eslint, javascript
Bereich
cli, tooling

Rechercherichtung

Start in oracle-gaps/owners.mjs around line 174, where the 'not a literal list' refusal is raised, and read readOwns to see which initializer forms it accepts. Done means the refusal names a concrete fix, and the CLI and the proposed eslint-plugin-oracles rule agree on the accepted forms, including whether as const on a literal array is allowed. The as-const and plugin decisions need maintainer input before coding.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Reported from an adopter's first session, at c58b0c2.

Problem. The adopter shared one const OWNS = [...] as const across four oracleProperty calls. The CLI refuses that with "its owns list is not a literal list" (oracle-gaps/owners.mjs:174). readOwns also rejects { owns } shorthand, spreads, and owns: [...] as const, because it requires the initializer to be an ArrayLiteralExpression of string literals.

Proposal.

  • Give the refusal a fix line, such as "write owns inline as owns: ['src/x.ts#fn'] in each call".
  • Possibly add an eslint-plugin-oracles rule, so this shows up in lint before a gap-check run.

The CLI and the plugin must agree on exactly which forms they accept. Also decide whether as const on a literal array should be accepted, since it doesn't change the static list.

This issue was written by Isaac.

Vorherrschende Sprache
JavaScript
Sterne
5
Forks
1
Ø Merge
6 Std.
Gemergte PRs (30 T.)
56

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus TanStack/oracles

Alle Issues in TanStack/oracles

Ähnliche Issues

Weitere Issues zu JavaScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.