Do an extremely thorough investigation of any type usage in this codebase. I need to…
- User
Do an extremely thorough investigation of
anytype usage in this codebase. I need to understand:-
Distribution: Where are
anytypes concentrated? Which directories/files have the most? -
Categories: Classify the
anyusages into categories like:- Intentional/unavoidable (e.g., generic callbacks, library interop)
- Type assertions hiding complexity
- Lazy typing (could easily be typed)
- Missing type definitions
- Event handlers
- Error catch blocks
- API responses / database types
- Function parameters
- Return types
-
Patterns: What recurring patterns lead to
any?- Are there specific hooks/utilities that propagate
any? - Are there database queries that return untyped data?
- Are there third-party libraries without types?
- Are there specific hooks/utilities that propagate
-
Risk Assessment: Which
anyusages are highest risk?- In shared code that's used everywhere
- In complex business logic
- At API boundaries
-
Quick Wins: Which files/patterns could be fixed easily with high impact?
Search comprehensively - check src/shared, src/tools, hooks, components, contexts, types directories. Look at both explicit
anyand implicit any (vianoImplicitAnyviolations if any).Provide concrete file paths, line numbers, and code examples for each category.
-
Assistant
I'll conduct a comprehensive investigation of
anytype usage in this codebase. Let me start with a broad search and then categorize the findings.Assistant
Let me refine my search to exclude node_modules and use a better regex pattern:
Assistant
Interesting - the simple patterns aren't matching. Let me try broader searches:
Assistant
Good! Now let me get a complete count and categorize them more systematically:
Assistant
Now let me get the breakdown by category and location:
Assistant
Great! Now let me examine the top files in detail and categorize them. Let me start with the files that have the most
anyusage:Assistant
Excellent. Let me now gather more samples systematically to categorize the
anytypes:Assistant
Now let me examine some specific patterns more thoroughly:
Assistant
Let me check the directory breakdown and some specific pattern files:
Assistant
Now let me look at types files and some specific context/hook files:
Assistant
Let me examine a few more strategic areas - the database types and some of the problematic files:
Assistant
Let me get a few more examples of the higher-risk any usages:
Assistant
Perfect! Now let me do a final analysis sweep to get detailed categorization:
Assistant
Excellent! Now let me get the risk-rated files and create a comprehensive report:
- User
[Request interrupted by user]