Skip to content

Concise & verbose comment syntax for "weak" not fully working? #144

@fabd

Description

@fabd

In the following simple test case, the "weak" option doesn't seem to work with the verbose comment:

No eslint warning:

/** @define VuePage; weak */
.VuePage { 
  background: #f8f8f8;

  h3 {
    color: red;
  }
}

1 eslint warning: "Invalid component selector ".VuePage h3"

/* postcss-bem-linter: define VuePage; weak */
.VuePage { 
  background: #f8f8f8;

  h3 {
    color: red;
  }
}

Have I misconfigured something?

Main reason I bring this up is that I'd prefer to use a consitent syntax, when I have to occasionally ignore something:

/* postcss-bem-linter: define ComponentName */
...
/* postcss-bem-linter: ignore */
...
etc

It's more explicit and less confusing than:

/** @define ComponentName */
...
/* postcss-bem-linter: ignore */
...
etc

That is, ignore seems to be available only with the verbose syntax. At the same time, the verbose syntax doesn't appear to support weak argument.

PS: Also I understand it's not good practice, but it seems fairly essential to be able to add simple elements such as h3, p etc. For example to add default styles to a Card component's body text. Is there a way to enable these while keeping the linting?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions