Defer standalone-component migration and disable prefer-standalone lint rule - #683
Open
fpigeonjr wants to merge 2 commits into
Open
Defer standalone-component migration and disable prefer-standalone lint rule#683fpigeonjr wants to merge 2 commits into
fpigeonjr wants to merge 2 commits into
Conversation
…nt rule Documents the decision to defer standalone-component migration for legacy NgModule-declared components (#584): - 189/190 flagged root components (3/3 in test-app) are standalone: false and registered via declarations: in one of 46 NgModules; the one standalone: true outlier is still consumed via declarations: too. - ESLint's own --fix for this rule strips standalone: false, flipping Angular's default to standalone: true, which broke 827 tests when tried in #582/PR #675 — a behavior change, not a style fix. - Several affected files are in the frozen consumer-deep-imports.json contract, so an uncoordinated migration risks breaking downstream consumers. Disables @angular-eslint/prefer-standalone explicitly (not just warns) in both eslint.config.mjs and test-app/eslint.config.mjs, with the rationale documented in AGENTS.md under a new "Standalone-component lint policy (deferred)" section, and lowers eslint-baseline.json to reflect the removed findings (root: 1619 -> 1369, test-app: 4 -> 1). Closes #584
There was a problem hiding this comment.
🟢 Approval recommended
The changes are limited to configuration/documentation updates and align with the stated decision, with only a minor wording/path clarity nit.
Pull request overview
Disables @angular-eslint/prefer-standalone in both workspaces and documents the rationale for deferring a standalone-component migration in this raw-source Angular library, while updating the lint warning baseline to reflect the removed findings.
Changes:
- Document the deferred standalone-component lint policy and rationale in
AGENTS.md. - Turn off
@angular-eslint/prefer-standalonein root andtest-appESLint configs (instead of leaving it as warnings). - Lower
eslint-baseline.jsonwarning counts to match the new lint output.
File summaries
| File | Description |
|---|---|
| AGENTS.md | Adds a documented decision/rationale for deferring standalone migration and disabling prefer-standalone. |
| eslint.config.mjs | Disables @angular-eslint/prefer-standalone in the root workspace and records rationale inline. |
| test-app/eslint.config.mjs | Disables @angular-eslint/prefer-standalone in test-app, referencing the documented rationale. |
| eslint-baseline.json | Updates warning baselines to reflect the rule being disabled. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
fpigeonjr
marked this pull request as ready for review
September 3, 2026 15:20
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.
Description
Decides the standalone-component lint policy for legacy NgModules and closes out the human-in-the-loop architecture decision tracked in #584 (child of the ESLint lint-debt epic, #580).
Decision: defer the standalone-component migration rather than migrate or leave the rule as an unactionable warning. Rationale (evaluated and documented in
AGENTS.md):@angular-eslint/prefer-standalone(3 intest-app), all but one are alreadystandalone: falseand registered viadeclarations:in one of 46 legacyNgModules. The singlestandalone: trueoutlier (SamAutocompleteComponent) is still consumed throughdeclarations:in two modules, so it doesn't reflect real usage either.--fixfor this rule mechanically stripsstandalone: false, flipping Angular's default tostandalone: true. This was tried in Apply safe ESLint autofixes and lower the baseline #582/PR Apply safe ESLint autofixes and lower the warning baseline #675 and brokeTestBed.configureTestingModulefor every spec declaring one of these components — 827 failing tests. It's a behavior change, not a style fix.hierarchical.module,progress.module,autocomplete.module,progress.component,autocomplete-multiselect.component,radiobutton.component,text.component,toolbar.component) are in the frozenscripts/consumer-deep-imports.jsoncontract — an uncoordinated migration risks breaking real downstream consumers, not just an internal refactor.Changes:
AGENTS.md— new "Standalone-component lint policy (deferred)" section under Lint, recording the decision and full rationale.eslint.config.mjs(root) — explicitly sets@angular-eslint/prefer-standaloneto"off"(not just a warning), with an inline comment cross-referencing the AGENTS.md rationale and this issue.test-app/eslint.config.mjs— same treatment, referencing the root config's rationale.eslint-baseline.json— lowered to reflect the removed findings: root1619 → 1369,test-app4 → 1.If a real standalone migration is ever undertaken, it will need its own epic, planned in consumer-safe slices (NgModule →
imports:rewrites, spec updates, coordinated consumer rollout) — explicitly out of scope here.Motivation and Context
Closes #584
Type of Change (Select One and Apply Label)
bugfixlabelenhancementlabelbreakinglabelmaintenancelabelHow to Test
npm ci && npm ci --prefix test-appnpm run lint:baseline→ 0 errors, 1369 warnings (root), gate passesnpm --prefix test-app run lint:baseline→ 0 errors, 1 warning (test-app), gate passesnpm --prefix test-app test→ 152 test files / 1386 tests passnpm run coverage:check→ passes (coverage unaffected)npm run format:check→ passesnpm run validate:publish→ passes (784 packed files, 67 consumer deep imports verified)cd test-app && npm run build→ succeedsExpected result: All lint/test/coverage/publish/build gates pass.
eslint-baseline.jsonreflects the lowered warning counts, andgrep -c "prefer-standalone" eslint-report.json(either workspace) reports 0.Screenshots (if appropriate)
N/A — no UI changes, lint policy and documentation only.
Checklist
gh-<number>-<slug>)format:checkpasses (npm run format:check)lintpasses (npm run lint)buildpasses (cd test-app && npm run build)cd test-app && npm test)