feat(vue/no-multi-spaces): add ignoreEOLComments property#2989
feat(vue/no-multi-spaces): add ignoreEOLComments property#2989waynzh merged 3 commits intovuejs:masterfrom
Conversation
🦋 Changeset detectedLatest commit: 7b93db3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
FloEdelmann
left a comment
There was a problem hiding this comment.
Looks good to me, thank you! 🙂
There was a problem hiding this comment.
Pull request overview
This PR adds a new ignoreEOLComments option to the vue/no-multi-spaces rule, allowing users to preserve multiple spaces before end-of-line comments for alignment purposes. When enabled, the rule will ignore multiple spaces that appear before line comments (//) or block comments (/* */) at the end of a line.
Key Changes
- Added
ignoreEOLCommentsboolean option to the rule schema with a default value offalse - Implemented logic to detect comments at the end of lines and conditionally ignore spaces before them
- Added test cases demonstrating both valid and invalid usage with the new option
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
lib/rules/no-multi-spaces.js |
Added schema property and implementation logic to detect and ignore spaces before EOL comments when the option is enabled |
tests/lib/rules/no-multi-spaces.js |
Added valid test cases showing comments with multiple spaces when ignoreEOLComments: true, and invalid test cases showing they're flagged when ignoreEOLComments: false |
docs/rules/no-multi-spaces.md |
Added documentation for the new option with usage examples showing alignment of comments |
.changeset/swift-spies-nail.md |
Added changeset entry documenting this as a minor version feature addition |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
resolves #2666