Skip to content
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

feat: adds no-extra-spacing-text #215

Merged
merged 7 commits into from
Sep 5, 2024

Conversation

RobertAKARobin
Copy link
Contributor

This adds a rule to prevent unnecessary whitespace in text.

*/
function stripConsecutiveSpaces(node) {
const text = node.value;
const matcher = /(^|[^\n \t])([ \t]{2,})($|[^\n \t])/g;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This regex doesn't seem to match trailing spaces. Is it possible to handle trailing whitespace as well?

// spaces exists after the span
    {
      code: `
<div>
   <span></span>  
</div>
      `,
      output: `
<div>
   <span></span>
</div>
      `,
      errors: errorsAt([3, 16, 2]),
    },
  ],
스크린샷 2024-09-04 오전 1 11 02

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yeonjuan Added!

Copy link
Owner

@yeonjuan yeonjuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!! Thank you for doing this work.

@yeonjuan yeonjuan merged commit 8adb2a5 into yeonjuan:main Sep 5, 2024
3 checks passed
@RobertAKARobin RobertAKARobin deleted the no-extra-spacing-text branch September 5, 2024 13:26
@TheElegantCoding
Copy link

Hello i dont see this rule in the website, the doc is updated ?

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

Successfully merging this pull request may close these issues.

3 participants