Skip to content

Conversation

@brettz9
Copy link
Collaborator

@brettz9 brettz9 commented Aug 11, 2025

fix(no-types, require-example, implements-on-classes): allow any to match function variable declarations; fixes #1446

…ny` to match function variable declarations; fixes gajus#1446
@brettz9 brettz9 added the bug label Aug 11, 2025
@brettz9 brettz9 requested a review from Copilot August 11, 2025 19:59
Copy link
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 fixes an issue where the any context configuration was not properly matching function variable declarations in three JSDoc rules. The fix allows the rules to detect TypeScript-style arrow function variable declarations when using the any context.

  • Adds a new isIteratingFunctionOrVariable utility function that extends function detection to include variable declarations with function initializers
  • Updates three rules to use the new utility instead of the original isIteratingFunction
  • Adds comprehensive test coverage for both regular and exported function variable declarations

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/iterateJsdoc.js Implements the new isIteratingFunctionOrVariable utility function and refactors isIteratingFunction
src/rules/requireExample.js Updates to use isIteratingFunctionOrVariable for broader function detection
src/rules/noTypes.js Updates to use isIteratingFunctionOrVariable for broader function detection
src/rules/implementsOnClasses.js Updates to use isIteratingFunctionOrVariable for broader function detection
test/rules/assertions/requireExample.js Adds test case for function variable declarations with TypeScript syntax
test/rules/assertions/noTypes.js Adds test cases for both regular and exported function variable declarations
docs/rules/require-example.md Updates documentation with example of function variable declaration
docs/rules/no-types.md Updates documentation with examples of function variable declarations
@brettz9 brettz9 merged commit 0867728 into gajus:main Aug 11, 2025
4 checks passed
@github-actions
Copy link

🎉 This PR is included in version 53.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@brettz9 brettz9 deleted the no-types-any branch August 11, 2025 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

1 participant