Skip to content

Conversation

@brettz9
Copy link
Collaborator

@brettz9 brettz9 commented Sep 3, 2025

fix(check-template-names, require-template): ensure template name is based on what is within any brackets and preceding equal sign; fixes #1466

… is based on what is within any brackets and preceding equal sign; fixes gajus#1466
@brettz9 brettz9 added the bug label Sep 3, 2025
@brettz9 brettz9 requested a review from Copilot September 3, 2025 08:47
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 a bug in the check-template-names and require-template rules related to parsing template names that use bracket notation with default values (e.g., @template [ChannelDataType=undefined]). The fix ensures template names are correctly extracted from complex template declarations.

  • Replaces manual string splitting with a centralized parseClosureTemplateTag utility function
  • Adds test coverage for template declarations with bracket notation and default values
  • Updates documentation with an example demonstrating the fixed functionality

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/rules/checkTemplateNames.js Uses parseClosureTemplateTag utility instead of manual string splitting
src/rules/requireTemplate.js Uses parseClosureTemplateTag utility instead of manual string splitting
test/rules/assertions/checkTemplateNames.js Adds test case for bracket notation template with default value
docs/rules/check-template-names.md Adds documentation example showing bracket notation template usage

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@brettz9 brettz9 merged commit 5fbab65 into gajus:main Sep 3, 2025
4 checks passed
@github-actions
Copy link

github-actions bot commented Sep 3, 2025

🎉 This PR is included in version 54.3.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

1 participant