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

Open
#69 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
1-2 days
Newbie friendliness
30/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
eslint, javascript
Domain
cli, tooling

Research direction

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.

Written by the indexing model from the issue text.

Description

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.

Dominant language
JavaScript
Stars
5
Forks
1
Avg merge
6h
Merged PRs (30d)
56

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from TanStack/oracles

All issues in TanStack/oracles

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.