Repository navigation
feat(ui): expand TypeScript and Angular ESLint rules based on PR review audit - #723
Merged
Merged
Conversation
…ew audit Expands static analysis rules in cmd/ui/eslint.config.js based on an empirical audit of 88 TypeScript/Angular PRs and 700+ review comments. Enforces strict equality, default immutability, console bans, Angular component lifecycle hygiene, and template accessibility across the UI codebase. TAG=agy CONV=e17b6ae9-1abb-4195-8dc6-49742ae7d2d7
There was a problem hiding this comment.
Code Review
This pull request updates the ESLint configuration in cmd/ui/eslint.config.js to enforce several new rules for JavaScript/TypeScript quality, TypeScript-specific checks, Angular component/lifecycle methods, and Angular templates. The review feedback suggests simplifying the @angular-eslint/directive-class-suffix rule by removing redundant default options and recommends adding @angular-eslint/component-class-suffix to enforce standard Angular naming conventions.
VLukiantsev
marked this pull request as ready for review
September 1, 2026 15:53
VLukiantsev
enabled auto-merge
September 1, 2026 15:54
AntonTyb
approved these changes
Sep 1, 2026
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.
Summary
Expands TypeScript and Angular ESLint rules in
cmd/ui/eslint.config.jsbased on an empirical audit of 88 frontend PRs and 700+ review comments. These rules enforce strict equality, default immutability (const), console statement bans, Angular component lifecycle hygiene, and HTML template accessibility directly during local pre-commit hooks and CI.Motivation & Context
During reviews on TypeScript and Angular PRs, automated review bots (Gemini Code Assist) and peer reviewers frequently flag recurring anti-patterns (such as loose equality comparisons, mutable variable declarations, leftover
console.logstatements in production code, empty lifecycle hooks, and template accessibility omissions). Enabling these rulesets in ESLint catches these issues automatically before PR submission, reducing review round-trips.Key Changes
cmd/ui/eslint.config.js) & Empirical PR Evidence:eqeqeq: Enforces strict type equality (===/!==) over loose equality comparisons. (Triggered in reviews on feat(ui): render ChartArtifact plots full-width on the work unit page #710)prefer-const: Enforces default immutability by requiringconstfor variables that are never reassigned. (Triggered in reviews on feat(ui): render ChartArtifact plots full-width on the work unit page #710, fix(health_service): fallback db schema version to UNAVAILABLE and format as hyphen in UI #689)no-var: Prohibitsvardeclarations in favor of block-scopedconstandlet.no-console: Prohibits rawconsole.logstatements in production files while permittingwarn,error, andinfo. (Triggered in reviews on feat(ui): render ChartArtifact plots full-width on the work unit page #710, fix(health_service): fallback db schema version to UNAVAILABLE and format as hyphen in UI #689)@typescript-eslint/no-duplicate-enum-values: Prevents duplicate enum values that mask missing branch cases.@typescript-eslint/no-non-null-asserted-optional-chain: Prohibits dangerous non-null assertions on optional chains (e.g.a?.b!). (Triggered in reviews on feat(ui): render ChartArtifact plots full-width on the work unit page #710)@typescript-eslint/no-unnecessary-type-constraint: Eliminates redundantextends any/extends unknowngeneric constraints.@typescript-eslint/prefer-as-const: Enforcesas constassertions over explicit literal type declarations.@typescript-eslint/prefer-for-of: Encourages idiomaticfor...ofloops over indexedforloops where index is unused.@typescript-eslint/no-inferrable-types: Eliminates redundant type annotations on trivially initialized variables.@typescript-eslint/no-empty-object-type: Disallows{}as a type annotation in favor of explicit object types orRecord<string, unknown>.@typescript-eslint/no-wrapper-object-types: Disallows wrapper object types (e.g.String,Number,Boolean).@angular-eslint/no-empty-lifecycle-method: Detects and flags emptyngOnInit/ngOnDestroystubs left in components. (Triggered in reviews on Feat/metrics dash plot card #461)@angular-eslint/contextual-lifecycle: Enforces that Angular lifecycle methods (ngOnInit,ngOnDestroy) are only declared on components and directives, not services or helper classes. (Triggered in reviews on Feat/metrics dash plot card #461, fix(ui): add error banner and retry loading feedback to configuration card #677)@angular-eslint/no-pipe-impure: Enforces that Angular pipes are declared pure by default to prevent change-detection performance regressions.@angular-eslint/directive-class-suffix: Enforces the standardDirectivesuffix on directive class names.@angular-eslint/template/elements-content: Ensures headings, buttons, and anchors contain accessible text or ARIA content. (Triggered in reviews on feat(ui): adopt outlined input boxes with primary resource label and inline tooltip #684, fix(ui): introduce shared error banner and integrate in admin panel #670)@angular-eslint/template/no-positive-tabindex: Prohibits positivetabindexvalues (> 0) that disrupt natural DOM keyboard navigation. (Triggered in reviews on feat(ui): adopt outlined input boxes with primary resource label and inline tooltip #684)Verification & Testing
npm run lint(incmd/ui)npm run format:check(incmd/ui)python3 -m unittest discover -s tools -p "*_test.py"./.githooks/pre-commit./tools/analyze_diff_size.py --base-ref origin/main...should_trigger_split_verifier: false).Related Issues / Bugs
N/A
TAG=agy
CONV=e17b6ae9-1abb-4195-8dc6-49742ae7d2d7