Skip to content

'Hyphenated BEM' regex not behaving as expected #89

@davidpmccormick

Description

@davidpmccormick

I'm trying to emulate the 'hyphenated BEM' selector format from scss-lint, but the regex I've got doesn't work in the context of the plugin (I'm fairly sure the regex itself is sound – it behaves as expected if I run it through e.g. regexper

Here's my componentSelectors property:

"componentSelectors": {
  "initial": "^\\.{componentName}(((__|--)(([a-z0-9]+(?!-$)-?)+))+)?"
}

If I've defined a article-intro, then I would expect e.g. article-intro__heading or article-intro--primary to be good matches, and article-intro-_ to be an error, but the linter isn't currently complaining at all about .article-intro-_. Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions