rstacruz / stylelint-rscss

Validate CSS with RSCSS conventions
MIT License
75 stars 6 forks source link

Nested components trigger the "invalid element name" rule #9

Open Ambrosia opened 7 years ago

Ambrosia commented 7 years ago

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).

fiskhandlarn commented 7 years ago

+1!

lederer commented 6 years ago

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]+)*$"
        }
    ]
}