fix(no-undefined-types): check class and interface globals#1421
Merged
brettz9 merged 1 commit intogajus:mainfrom Jun 30, 2025
Merged
fix(no-undefined-types): check class and interface globals#1421brettz9 merged 1 commit intogajus:mainfrom
no-undefined-types): check class and interface globals#1421brettz9 merged 1 commit intogajus:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR extends the no-undefined-types rule to recognize class and interface global members, ensuring their properties and methods are treated as defined types. It adds corresponding tests and updates documentation examples.
- Enhance rule logic to handle
ClassDeclarationandTSInterfaceDeclaration, flattening member names. - Add new valid test cases for interface properties and class methods.
- Update markdown docs with interface and class usage examples.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| test/rules/assertions/noUndefinedTypes.js | Added valid test cases for interface property and class method references |
| src/rules/noUndefinedTypes.js | Switched map to flatMap and added switch handling for classes and interfaces |
| docs/rules/no-undefined-types.md | Inserted interface/class examples into documentation |
Comments suppressed due to low confidence (1)
docs/rules/no-undefined-types.md:975
- The new interface and class examples are not wrapped in a Markdown code fence or have mismatched fence counts, which will break formatting. Add a matching ```js block before these lines or adjust the closing fence.
export interface SomeInterface {
97450f1 to
f3a1708
Compare
|
🎉 This PR is included in version 51.3.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
fix(
no-undefined-types): check class and interface globals; fixes #1420