fix(lint): stop false root findings on template-wrapped sub-compositions#2447
Open
miguel-heygen wants to merge 1 commit into
Open
fix(lint): stop false root findings on template-wrapped sub-compositions#2447miguel-heygen wants to merge 1 commit into
miguel-heygen wants to merge 1 commit into
Conversation
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.
What
hyperframes lintno longer reportsroot_missing_dimensionsormultiple_root_compositionsfalse positives on template-wrapped mountable sub-composition files, the registry's shipped pattern for components mounted viadata-composition-src.Why
A mountable sub-composition keeps its renderable content inside
<body><template>, and its root is deliberately elastic (position: absolute; inset: 0, nodata-width/data-height) because the host clip sizes it. The linter treated that intentional shape as two defects: the elastic root firedroot_missing_dimensions, and the project-levelmultiple_root_compositionsscan double-counted a demo host plus its mounted sub-composition sitting in the same directory. Both findings are noise on correct-by-design files and train users to ignore the linter.How
packages/lint/src/utils.ts: new sharedresolveRootStructure()helper (extracted from the template-unwrap logic already incontext.ts), exposingisTemplateWrappedRoot.packages/lint/src/context.ts: uses the shared helper and threadsisTemplateWrappedRootontoLintContext.packages/lint/src/rules/core.ts:root_missing_dimensionsskips template-wrapped elastic roots;root_missing_composition_idbehavior unchanged.packages/lint/src/project.ts:lintMultipleRootCompositionsexcludes template-wrapped sub-composition files from the root count (exceptindex.html).stripHtmlCommentsun-exported (internal-only after the refactor), pre-existing complexity/duplication findings suppressed with documented rationale following existing repo precedent.Test plan
root_missing_dimensions, and genuine duplicate roots still firemultiple_root_compositions.packages/lint: 367/367 tests pass. Repo root build, lint, and typecheck pass.