Maxim Yelizarenko created SLING-9054:
----------------------------------------
Summary: [HTL] htl-maven-plugin: show warning for redundant use of
data-sly-unwrap
Key: SLING-9054
URL: https://issues.apache.org/jira/browse/SLING-9054
Project: Sling
Issue Type: Improvement
Components: Scripting
Affects Versions: HTL Maven Plugin 1.3.4-1.4.0
Reporter: Maxim Yelizarenko
I'm working on a project where the existing HTL code has multiple instances of
redundant unconditional `data-sly-unwrap` block statement on a `<sly>` tag,
such as:
{code:java}
<sly data-sly-test="${foo}" data-sly-unwrap>${bar}</sly>
{code}
While this syntax is not incorrect, it is definitely a 'code smell' and it
would be nice to have the htl-maven-plugin to report a warning when
`data-sly-unwrap` is used on a `<sly>` tag.
----
As an additional nice-to-have, it would also be great to have a warning to
suggest the replacement of `data-sly-unwrap` with `<sly>` tag, when the
`data-sly-unwrap` is either unconditional or always truthy, and the HTL version
is 1.1 or greater:
{code:java}
<div data-sly-test="${foo}" data-sly-unwrap="${true}">${bar}</div>{code}
{code:java}
Suggest replacement with:
<sly data-sly-test="${foo}">${bar}</div>{code}
However, since this is more specific to code style, it may require a
configuration parameter for opting out.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)