Skip to content

Conversation

brettz9
Copy link
Collaborator

@brettz9 brettz9 commented Jun 22, 2025

feat: strip property when there is a class tag and the context is set; fixes #1376

@brettz9 brettz9 requested a review from Copilot June 22, 2025 21:34
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/@prop in class contexts
  • Add a new test case covering @property type 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 @prop alias as well, since the implementation strips both @property and @prop tags.
    {

@brettz9 brettz9 merged commit 08f7834 into gajus:main Jun 22, 2025
4 checks passed
@brettz9 brettz9 changed the title feat: strip property when there is a class tag and the context is set feat: strip property when the context is ClassDeclaration Jun 22, 2025
Copy link

🎉 This PR is included in version 51.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@brettz9 brettz9 deleted the no-types-property branch June 22, 2025 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add @property to the no-types rules
1 participant