Skip to content

feat(require-hyphen-before-param-description): when always is set, disallow hyphen at end of line #1454

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

brettz9
Copy link
Collaborator

@brettz9 brettz9 commented Aug 16, 2025

feat(require-hyphen-before-param-description): when always is set, disallow hyphen at end of line; fixes #1435

@brettz9 brettz9 requested a review from Copilot August 16, 2025 09:57
@brettz9 brettz9 added the bug label Aug 16, 2025
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 enhances the require-hyphen-before-param-description rule to handle a specific edge case where hyphens at the end of lines (before descriptions that start on the next line) cause display issues in Visual Studio Code. When the rule is configured to "always" require hyphens, it now disallows hyphens that appear at the end of a line without any description text following on the same line.

Key changes:

  • Added logic to detect hyphens followed immediately by newlines and treat them as invalid even when "always" mode is enabled
  • Updated the fixer to properly handle the removal of trailing hyphens
  • Added comprehensive test cases covering the new behavior

Reviewed Changes

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

File Description
src/rules/requireHyphenBeforeParamDescription.js Core rule implementation with new logic to detect and handle trailing hyphens
test/rules/assertions/requireHyphenBeforeParamDescription.js Test cases for the new trailing hyphen detection behavior
docs/rules/require-hyphen-before-param-description.md Documentation updates explaining the new behavior and fixer functionality
.README/rules/require-hyphen-before-param-description.md README template updates matching the documentation changes

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[require-hyphen-before-param-description]: Except when line break
1 participant