Skip to content

Less validate check seem incorrectly as expected #456

Open
@mrtuvn

Description

@mrtuvn

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions