refactor: reduce explicit any types#566
Merged
Merged
Conversation
Change [key: string]: any to [key: string]: unknown in NodeProperties. Remove 19 redundant (node.properties as any) casts in csv-generator.ts — all accessed properties are already declared on the type.
Mechanical substitution — all tree-sitter AST node parameters and variables typed as any are now properly typed as SyntaxNode. - ast-helpers.ts: 13 any → SyntaxNode - parsing-processor.ts: 8 any → SyntaxNode - parse-worker.ts: 40 any → SyntaxNode/TreeSitterLanguage/Parser.Query - php.ts: 11 any → SyntaxNode Also adds TreeSitterLanguage type alias for optional grammar loading.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
CI Report✅ All checks passed Pipeline Status
Test Results
✅ All 4646 tests passed 46 test(s) skipped — expand for details
Code CoverageTests
📋 View full run · Generated by CI |
- call-processor, call-routing, c-cpp: SyntaxNode substitutions - parse-worker: typed WorkerIncomingMessage discriminated union - worker-pool: typed WorkerOutgoingMessage + Error handler - ast-cache, import-processor: targeted cast for Tree.delete() - community-processor: graphology AbstractGraph types, LeidenModule interface for vendored leiden code Ingestion layer: 130 → 7 any warnings remaining.
icodebuster
pushed a commit
to icodebuster/GitNexus
that referenced
this pull request
Mar 31, 2026
* main: (114 commits) feat(csharp): C# MethodExtractor config (abhigyanpatwari#582) docs: add gitnexus-shared build step before gitnexus-web (abhigyanpatwari#585) chore: add enterprise offering section to README, ignore local_docs/ (abhigyanpatwari#579) fix(eval): exclude litellm 1.82.7 and 1.82.8 due to compatibility issues (abhigyanpatwari#580) feat(java,kotlin): MethodExtractor abstraction with per-language configs (abhigyanpatwari#576) feat: added skip-agents-md cli flag (abhigyanpatwari#517) feat(wiki): Azure OpenAI support for wiki command (abhigyanpatwari#562) refactor: reduce explicit any types (abhigyanpatwari#566) feat(java): method references, worker overload disambiguation, interface dispatch (abhigyanpatwari#540) feat: configure eslint with unused import removal (abhigyanpatwari#564) feat: configure prettier with pre-commit hook (abhigyanpatwari#563) feat: unify web and cli ingestion pipeline (abhigyanpatwari#536) fix/opencode mcp gitnexus timeout (abhigyanpatwari#363) chore: bump version to 1.4.10, update CHANGELOG fix: resolve tree-sitter peer dependency conflicts (abhigyanpatwari#538) chore: bump version to 1.4.9, add CHANGELOG.md refactor: Phase 8 & 9 — Field Types and Return-Type Binding (abhigyanpatwari#494) feat: add COBOL language support with regex extraction pipeline (abhigyanpatwari#498) fix: close remaining Dart language support gaps (abhigyanpatwari#524) refactor: split global BUILT_IN_NAMES into per-language provider fields (abhigyanpatwari#523) ... # Conflicts: # gitnexus/src/core/wiki/llm-client.ts
motolese
pushed a commit
to motolese/datamoto-gitnexus
that referenced
this pull request
Apr 23, 2026
* refactor: replace NodeProperties index signature any with unknown Change [key: string]: any to [key: string]: unknown in NodeProperties. Remove 19 redundant (node.properties as any) casts in csv-generator.ts — all accessed properties are already declared on the type. * refactor: replace any with SyntaxNode across ingestion layer Mechanical substitution — all tree-sitter AST node parameters and variables typed as any are now properly typed as SyntaxNode. - ast-helpers.ts: 13 any → SyntaxNode - parsing-processor.ts: 8 any → SyntaxNode - parse-worker.ts: 40 any → SyntaxNode/TreeSitterLanguage/Parser.Query - php.ts: 11 any → SyntaxNode Also adds TreeSitterLanguage type alias for optional grammar loading. * refactor: eliminate remaining any in ingestion layer - call-processor, call-routing, c-cpp: SyntaxNode substitutions - parse-worker: typed WorkerIncomingMessage discriminated union - worker-pool: typed WorkerOutgoingMessage + Error handler - ast-cache, import-processor: targeted cast for Tree.delete() - community-processor: graphology AbstractGraph types, LeidenModule interface for vendored leiden code Ingestion layer: 130 → 7 any warnings remaining.
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
Incremental reduction of explicit
anytypes across the codebase. Three high-leverage fixes targeting the ingestion layer:1. NodeProperties index signature (
gitnexus-shared/src/graph/types.ts)[key: string]: any→[key: string]: unknown(node.properties as any).fieldcasts incsv-generator.ts2. SyntaxNode substitution (ingestion layer, 4 files → 8 files)
anywithSyntaxNodeacrossparse-worker.ts,ast-helpers.ts,parsing-processor.ts,php.ts,call-processor.ts,call-routing.ts,c-cpp.tsTreeSitterLanguagetype alias for optional grammar loading3. Remaining ingestion cleanup (community-processor, worker-pool, ast-cache, import-processor)
AbstractGraphfor community detectionLeidenModuleinterface for vendored leiden codeWorkerIncomingMessage/WorkerOutgoingMessagediscriminated unions for worker protocolTree.delete()(missing from tree-sitter types)Result: 689 → 561
no-explicit-anywarnings (128 eliminated, 19% reduction)Ingestion layer specifically: 130 → 7 warnings (95% reduction)
Files changed
gitnexus-shared/src/graph/types.ts[key: string]: any→unknowngitnexus/src/core/lbug/csv-generator.tsas anycastsgitnexus/src/core/ingestion/utils/ast-helpers.tsany→SyntaxNodegitnexus/src/core/ingestion/parsing-processor.tsany→SyntaxNodegitnexus/src/core/ingestion/workers/parse-worker.tsgitnexus/src/core/ingestion/workers/worker-pool.tsgitnexus/src/core/ingestion/languages/php.tsany→SyntaxNodegitnexus/src/core/ingestion/call-processor.tsany→SyntaxNodegitnexus/src/core/ingestion/call-routing.tsany→SyntaxNodegitnexus/src/core/ingestion/type-extractors/c-cpp.tsany→SyntaxNodegitnexus/src/core/ingestion/community-processor.tsgitnexus/src/core/ingestion/ast-cache.tsgitnexus/src/core/ingestion/import-processor.tsTest plan
npx tsc --noEmitpasses in gitnexus/ and gitnexus-shared/npx prettier --check .passes