fix: generated eslint config only imports what package.json installs - #121
Merged
Conversation
Collaborator
Author
|
Second commit widens the fix to the root cause the first one exposed: |
The eslint.config.mjs template imported globals, typescript-eslint, and the react plugins unconditionally while the registry entry shipped only eslint + @eslint/js — the react-plugin dep rule fired for vite-react alone, so every other base failed its first pre-push lint with missing packages. - globals + typescript-eslint move into the registry eslint entry (unconditional import -> unconditional dependency) - react plugin imports are now conditional on the base's react integration, and the dep rule tracks the same condition (astro-react included) - the files glob drops vue/astro extensions no shipped parser can handle TestGeneratedConfigImportsAreInstalled guards the whole class: for every representative combo, each package imported by a generated top-level config file must be installed by the generated package.json. Closes #118 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
GetIntegration returned an error whenever the registry WAS loaded (and would nil-deref when it wasn't), so IsReactInt/IsVueInt always returned false — the eslint template's react branch could never fire, and IsVueInt additionally compared against "react". Fixed both, guarded the nil entry, and pinned every base's IsReactInt/IsVueInt plus the positive react-plugin wiring (config imports AND installed deps) in tests. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
spencer-osbrjp
force-pushed
the
i118-20260812-1
branch
from
August 12, 2026 14:39
f00211c to
f3b9d11
Compare
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.
Closes #118
Root cause
templates/linter/eslint/eslint.config.mjs.tmplimportedglobals,typescript-eslint,eslint-plugin-react-hooks, andeslint-plugin-react-refreshunconditionally, but the registry's eslint entry only shipseslint+@eslint/js, and the react-plugin dependency rule fired only forvite-react. Every other base (the reporter used plain Astro) hitCannot find packageon its first husky pre-push lint. The**/*.{ts,tsx,vue,astro}glob also fed.astro/.vuefiles to a config with no matching parser.Fix
globals+typescript-eslintmove into the registry's eslint entry — an unconditional import is an unconditional dependency.IsReactIntcondition, and the dep rule now tracks the same condition (vite-reactandastro-react, which was silently broken too).**/*.{ts,tsx}— matching what the shipped config can actually parse.Plain-Astro output now matches the issue's "working config" verbatim.
Preventing the class
New
TestGeneratedConfigImportsAreInstalled: scaffolds nine representative combos (every base × eslint, ox tooling, playwright, defaults) and asserts that every package imported by a generated top-level config file is installed by the generated package.json. Any future template/registry drift of this kind fails CI instead of the user's first push.Testing
go test ./...green (the new guard test fails on the pre-fix templates for astro/astro-vue/vite-vue/nuxt/astro-react). E2E: scaffolded-t astro, confirmed the rendered config and devDependencies line up.🤖 Generated with Claude Code