Skip to content

feat: strip property when the context is ClassDeclaration#1414

Merged
brettz9 merged 3 commits intogajus:mainfrom
brettz9:no-types-property
Jun 22, 2025
Merged

feat: strip property when the context is ClassDeclaration#1414
brettz9 merged 3 commits intogajus:mainfrom
brettz9:no-types-property

Conversation

@brettz9
Copy link
Copy Markdown
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
Copy Markdown
Contributor

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.
    {

Comment thread docs/rules/no-types.md Outdated
Comment thread .README/rules/no-types.md Outdated
Comment thread src/rules/noTypes.js
brettz9 and others added 2 commits June 23, 2025 05:36
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@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
@github-actions
Copy link
Copy Markdown

🎉 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

2 participants