magento/magento-coding-standard

Less validate check seem incorrectly as expected

mrtuvn opened this issue · 1 comments

Preconditions

  1. Any version magento 2 (Example 2.4.6+)

When i checked docs related
Sort all properties in the alphabetical order. Mixins, variables, and so on should go first.
https://devdocs.magento.com/guides/v2.3/coding-standards/code-standard-less.html. But the results validate difference than doc
mention

Steps to reproduce

  1. Change file app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/_module.less
  2. Go to the code line around 154
.additional-attributes {
//Some code here
}

Following standards => Show warning (Mixins, variables go first same as docs recommends)

.additional-attributes {
            .lib-table-bordered(@_table_type: clear);
            .lib-table-resize(@_th-padding-left: 0, @_th-padding-right: @indent__l, @_th-padding-bottom: @indent__s, @_td-padding-bottom: @indent__s);
           width: auto;
        }

Nope this way is correct validate instead (No i don't want to follow standards). No warning anymore

.additional-attributes {
            width: auto;
            .lib-table-bordered(@_table_type: clear);
            .lib-table-resize(@_th-padding-left: 0, @_th-padding-right: @indent__l, @_th-padding-bottom: @indent__s, @_td-padding-bottom: @indent__s);
        }

Expected result

  1. No code warning

Actual result

  1. Code warning require Sort all properties in the alphabetical order.

Hi @mrtuvn. Thank you for your report.
To speed up processing of this issue, make sure that you provided sufficient information.
Add a comment to assign the issue: @magento I am working on this


Join Magento Community Engineering Slack and ask your questions in #github channel.