stylelint-rscss icon indicating copy to clipboard operation
stylelint-rscss copied to clipboard

Nested components trigger the "invalid element name" rule

Open Ambrosia opened this issue 7 years ago • 2 comments

Hi,

This page advises you to set a component's positioning in the parent component. However, actually doing this triggers the invalid element name rule.

Perhaps it would be a good idea to stop this and instead add a new rule that triggers if the nested component applies the positioning properties not mentioned here (with a different error).

Ambrosia avatar Apr 05 '17 02:04 Ambrosia

+1!

fiskhandlarn avatar Oct 24 '17 14:10 fiskhandlarn

A workaround is to configure the element rule in .stylelintrc to use a regexp that accepts both component and element names. Eg:

"rules": {
    "rscss/class-format": [
        true,
        {
            "element": "^([a-z][a-z0-9]*)(-[a-z0-9]+)*$"
        }
    ]
}

lederer avatar Jan 13 '18 20:01 lederer