Skip to content

Conversation

@domingo2000
Copy link
Contributor

@domingo2000 domingo2000 commented Oct 1, 2025

Implements the SpaceInHtmlTag rule from ERBLint.

This rules avoid having whitespace in the html.

This is a Proof of concept of the implementation. I considered

  1. If the parser already throws a parser error, the linter from erb-lint makes no sense (ej: </ div>)
  2. It follows the result that the formatter would give. For example, for multiline, the whitespace must have 2 spaces.

Resolves #549

@domingo2000 domingo2000 force-pushed the add-html-no-space-in-html-tag branch 3 times, most recently from 25e3965 to 2c0fcc4 Compare October 1, 2025 13:43
@domingo2000 domingo2000 changed the title Linter: Implement linter rule (#549) Oct 1, 2025
@domingo2000 domingo2000 mentioned this pull request Oct 1, 2025
6 tasks
@marcoroth marcoroth changed the title Linter: Implement html-no-space-in-html-tag linter rule (#549) Oct 5, 2025
@domingo2000 domingo2000 force-pushed the add-html-no-space-in-html-tag branch 2 times, most recently from ac6471a to ea3881e Compare October 6, 2025 01:49
@domingo2000 domingo2000 force-pushed the add-html-no-space-in-html-tag branch from ea3881e to 4f96667 Compare October 6, 2025 01:59
Copy link
Owner

@marcoroth marcoroth left a comment

Choose a reason for hiding this comment

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

Thank you for working on this @domingo2000! 🙏🏼

@marcoroth marcoroth merged commit de492bd into marcoroth:main Oct 10, 2025
1 check passed
marcoroth added a commit that referenced this pull request Oct 20, 2025
The `html-no-space-in-tag` linter rule (#559 and #642) has quite a few
false positives and corrupts documents when using the `--fix` option
(see #695), which is why this pull request removes the
`html-no-space-in-tag` rule from the default rules for now.

We can enable this rule again in the future when we improve the accuracy
of the rule.
asilano pushed a commit to fac/herb that referenced this pull request Oct 21, 2025
)

Implements the `SpaceInHtmlTag` rule from
[ERBLint](https://github.com/Shopify/erb_lint).

This rules avoid having whitespace in the html.

This is a Proof of concept of the implementation. I considered

1. If the parser already throws a parser error, the linter from erb-lint
makes no sense (ej: `</ div>`)
2. It follows the result that the formatter would give. For example, for
multiline, the whitespace must have 2 spaces.

Resolves marcoroth#549

---------

Co-authored-by: Marco Roth <marco.roth@intergga.ch>
asilano pushed a commit to fac/herb that referenced this pull request Oct 21, 2025
…coroth#697)

The `html-no-space-in-tag` linter rule (marcoroth#559 and marcoroth#642) has quite a few
false positives and corrupts documents when using the `--fix` option
(see marcoroth#695), which is why this pull request removes the
`html-no-space-in-tag` rule from the default rules for now.

We can enable this rule again in the future when we improve the accuracy
of the rule.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment