Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-9054

[HTL] htl-maven-plugin: show warning for redundant use of data-sly-unwrap

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: HTL Maven Plugin 1.3.4-1.4.0
    • Fix Version/s: None
    • Component/s: Scripting
    • Labels:
      None

      Description

      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: 

      <sly data-sly-test="${foo}" data-sly-unwrap>${bar}</sly>
      

      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:

      <div data-sly-test="${foo}" data-sly-unwrap="${true}">${bar}</div>
      Suggest replacement with:
      <sly data-sly-test="${foo}">${bar}</div>

      However, since this is more specific to code style, it may require a configuration parameter for opting out.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              deenamo Maxim Yelizarenko
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: