feat: strip property when the context is ClassDeclaration#1414
Merged
brettz9 merged 3 commits intogajus:mainfrom Jun 22, 2025
Merged
feat: strip property when the context is ClassDeclaration#1414brettz9 merged 3 commits intogajus:mainfrom
ClassDeclaration#1414brettz9 merged 3 commits intogajus:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds handling to strip type annotations from @property (and its alias @prop) tags when JSDoc appears on a ClassDeclaration and updates tests and documentation accordingly.
- Implement JSDoc fixer logic to report and remove types on
@property/@propin class contexts - Add a new test case covering
@propertytype stripping in a class - Update documentation and README to describe the new behavior and fixer
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| test/rules/assertions/noTypes.js | Added test for stripping type on @property in a class context |
| src/rules/noTypes.js | Implement logic to detect ClassDeclaration and remove type from @property/@prop |
| docs/rules/no-types.md | Document new behavior and update fixer description |
| .README/rules/no-types.md | Mirror documentation updates for README |
Comments suppressed due to low confidence (1)
test/rules/assertions/noTypes.js:260
- Consider adding a test case for the
@propalias as well, since the implementation strips both@propertyand@proptags.
{
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
class tag and the context is setClassDeclaration
|
🎉 This PR is included in version 51.2.0 🎉 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.
feat: strip property when there is a
classtag and the context is set; fixes #1376