GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||
GeezerVison is showing github.com — fix(eslint-plugin-oracles): load and parse with the consumer's parser by KyleAMathews · Pull Request #13 · TanStack/oracles Conversation
Contributor
Summary
The rule now parses each imported test module with the parser and parser options that ESLint already uses for the file it lints. It parses through ESLint's own The new oracle coverage found two more defects, and the repo's own lint found two problems in the first draft:
Evidence
Review roundA code review found no high-severity defect. This PR fixes these findings:
One finding is older than this PR and is not fixed here: Code weight
For the maintainer
This pull request and its description were written by Isaac.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions`oracle/no-unit-test` imported `@typescript-eslint/parser` at module load. That parser refuses TypeScript 7, so importing the plugin, and every one of its configs, threw in a repository that pins TypeScript 7.0.2 (field report round 3, nanostores). It also threw when `typescript` was absent. The rule now parses each imported test module with the parser and parser options that ESLint uses for the file it lints, through ESLint's own Linter, so any configured parser works, espree included. The parse cache is keyed on those language options too. typescript-eslint's type-aware options are left out of that parse: the rule reads syntax and scope only, and a nested `project` parse changed the program that type-aware rules then read (single- run mode). `@typescript-eslint/parser` moves to devDependencies. Also fixed, found by the extended oracle: under espree the rule dropped every reference (espree scopes have no `isValueReference`) and reported reaching tests as undeclared. And a module that did not parse was skipped silently: when a test reaches no part, each import of a module that the file's parser cannot read is now reported (unparsedModule) with the parser's error. The rule never throws on it. Evidence - Law: the plugin loads whatever the consumer's TypeScript (field report); rules never throw (maintainer decision 2026-11-08, #6); an imported module is parsed as ESLint parses the linted file (consumer-parser task). The narrowing of the report to files with an unreached test, and the strip of type-aware options, need maintainer confirmation. - Reach: new lint.part-reach.parsers family gates espree-oracle, espree-oracle-test-uses-part, oracle-imports-type-syntax-under-espree (fixed seed 82, 24, 56 of 103); unparseable-companion gates oracle-imports-unparseable-companion (20); new parser-switch law gates the type-syntax state (22). The TS environment is a focused test (consumer-typescript.test.js, 3 child-process cases). - RED (d1b508a rule): 13 of 84 fail. TS 7 stub: "typescript-eslint does not support TS 7.0."; absent: "Cannot find module 'typescript'"; espree: "unit:t0" read as "undeclared:t0"; broken import: "unparsed:broken.ts" missing. - GREEN: plugin suite 17 files, 4310 tests; typecheck, eslint, prettier, sherif, publint clean. A copy of the nanostores repro loads the plugin and lints an espree-readable oracle file. - Mutant: top-level parser import (consumer-typescript), fixed espree or fixed typescript-eslint (parsers, parser-switch), a throwing parse error (charged as threw:), the old isValueReference test (parsers), a cache that ignores the parser (parser-switch), kept type-aware options (typed-lint-isolation), eager reports (parsers, unparseable-companion). - Limits: the linted file's options, not the imported module's own, so a JS oracle importing a TS module with type syntax gets the report when a test is unreached; transitive unparseable modules are not reported; two parsers; a stub of TS 7's shape; ESLint 10 not run. Under TS 7, typescript-eslint itself cannot load, so .ts oracle files still cannot be linted there. no-unit-test.js grows 269 bytes min+gzip; the install drops the @typescript-eslint/parser tree. Co-authored-by: Isaac <[email protected]> …gnore inline config in imported modules Review round on the consumer-parser change: - Only reading and parsing an imported module is caught. An error in the rule's own analysis of a parsed module is a rule bug and is no longer reported as a parse failure. - The nested Linter ignores the imported module's eslint comments (noInlineConfig), so they run no core rules and print no env warnings. - The changeset states the two behaviors to expect: a module is parsed with the linted file's parser, and only direct imports report a parse failure. Co-authored-by: Isaac <[email protected]>
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page.
KyleAMathews
added a commit
that referenced
this pull request
…mmar
Agents go from examples to a general law only when made to write it
down, and no agent in three validation rounds opened the design-grammar
card, because it triggered on judgment ("a hard law").
- Design step 1: before the law sheet, each law gets a written block:
the examples with sources, what varies and what stays, the law as one
"For every ..." sentence with its edges, a new case it predicts, and
every example rebuilt from the sentence alone.
- Five concrete triggers send the agent to the design-grammar card; the
evidence says which fired.
- Review: "Law as examples" and "Skipped design grammar" findings.
- Evaluate-review: the causal condition is written as a sentence over
histories, with a second history it predicts.
- Setup: TypeScript 7 is an environment limit (typescript-eslint), and
the plugin's `unparsedModule` report for a `.js` oracle file that
imports TypeScript (#13).
- Design: the interim exit-wording bullet is gone with #12; the rule not
to write those words in a report stays.
Co-authored-by: Isaac <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersNo reviewsUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. | |||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |