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

Aperta
#69 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
1-2 giorni
Idoneità per principianti
30/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
eslint, javascript
Ambito
cli, tooling

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
JavaScript
Stelle
5
Fork
1
Merge medio
6h
PR unite (30g)
56

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di TanStack/oracles

Tutte le issue di TanStack/oracles

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.