You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Maxim Yelizarenko (Jira)" <ji...@apache.org> on 2020/02/05 23:36:00 UTC

[jira] [Updated] (SLING-9054) [HTL] htl-maven-plugin: show warning for redundant use of data-sly-unwrap

     [ https://issues.apache.org/jira/browse/SLING-9054?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Maxim Yelizarenko updated SLING-9054:
-------------------------------------
    Priority: Minor  (was: Major)

> [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
>            Priority: Minor
>
> 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)