Repository navigation
laws probe: wrap the project's ESLint config so Astro twins parse in any adopter - #73
Merged
Merged
Conversation
…nfig, so an adopter whose tsconfig does not include them is probed The twins are copied to .web-tops/out/laws-probe, which a project tsconfig that names its own sources does not include, and the astro preset parses a .astro file with the project tsconfig, so the Astro twins were not evaluated in a real adopter. The probe now writes a wrapper beside the scratch directory that imports the project config, found as ESLint finds it when none is named, and adds one block for the twins: the parser reads the scratch tsconfig, which extends the project one and includes every twin. A real adopter test, whose tsconfig has no include for .web-tops, proves W-49 passes over its Astro twins. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…nfig under Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
webtops laws probenow proves the Astro laws on a real adopter's project, not only on the kit's own test projects.Why
In an
astro-siteproject whose tsconfig names only its own sources (include: ["src/**/*"]), the probe reported all 18 W-49 twins asnot-evaluated. The Astro preset parses.astrofiles with the project's own tsconfig. That tsconfig doesn't include the probe's scratch directory, so ESLint answered "The file was not found in any of the provided program instance(s)". The result was honest but useless to the adopter.What it does
src/laws/probe/run.tsand the newsrc/laws/probe/wrapper.ts:laws-probe.eslint.config.mjsbeside its scratch directory, not inside it, so the wrapper isn't linted itself. The wrapper imports the project's ESLint config and adds one block for the scratch twins, which points the parser at the probe's scratch tsconfig. That tsconfig extends the project's own and includes every twin.--configset to the wrapper.--configorweb-tops.yaml;The wrapper applies to the TypeScript twins as well. That is what a project needs when it pins
parserOptions.projectto its root tsconfig, and for aprojectServiceproject it is the same program.Tests
src/cli/laws-probe-adopter.test.ts(new): runsbun src/cli/main.ts laws probeas a process, with real ESLint andtsc, on an adopter whose tsconfig says nothing about.web-tops. W-49 passes over its.astrotwins, with none skipped. This test failed before the fix.src/laws/probe/wrapper.test.ts(new): the exact wrapper text, its location beside the scratch directory, and the order in which config names are searched.src/laws/probe/run.test.ts: expects the wrapper and its import of the project's config, and no--configwhen there is no project config.A config whose default export isn't importable as an ES module is a known limit. The loader handles a default export or the module itself.
Gate on this head
layers: 5 in range, 5 ran, 0 failed, 0 not-evaluated.🤖 Generated with Claude Code