feat(lint): any-on-boundary rules + any/exported metadata in TS parser#65
Merged
Merged
Conversation
- Add _type_mentions_any() helper in typescript.py using \bany\b regex - Thread exported=True flag through _handle_function_decl and _handle_lexical_decl when called from the export_statement branch - Set metadata["exported"], metadata["any_params"], metadata["any_return"] on FUNCTION nodes for exported/any-typed functions and arrows - Add any-on-boundary lint rule (severity low): fires on exported function/arrow declarations that use `any` in a param type or return type - Add any-into-db-write lint rule (severity med): fires when an `as any` cast is passed as an argument to a DB-write chain - Add tests/fixtures/lint_sample/src/api.ts fixture covering all cases - Add parser tests in test_extractor_typescript.py for new metadata fields - Add lint tests in test_lint.py for both new rules
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
Stacked on #64 — final slice of the gap-analysis quick wins (Phase 3, Capability E):
exportedflag threaded fromexport_statementinto function/lexical-decl handlers;metadata["any_params"]/any_returnrecorded from the already-captured type annotations (word-boundary match —Promise<any>yes,Companyno).anyin a param or return type.as anycast passed as an argument to a DB-write chain (db.insert|update|execute,.values(,.set().Implemented by a Sonnet subagent against a Fable-authored spec; reviewed and verified by the orchestrating session.
Test plan
🤖 Generated with Claude Code