Skip to content

Fix no-invalid-position-declaration false positives for @mixin and @scope #9119

@jimblue

Description

@jimblue

What minimal example or steps are needed to reproduce the bug?

Getting an no-invalid-position-declaration error for following mixin:

@mixin text-smart-justification($justify: true) {
  max-inline-size: var(--text-max-inline-size);
  text-align: left;

  @if $justify {
    text-align: justify;
    text-align-last: left;
    hyphens: auto;
    hyphenate-limit-chars: 6 3 3;
    hyphenate-limit-lines: 2;

    @supports (text-wrap: pretty) {
      text-wrap: pretty; // stylelint-disable-line no-invalid-position-declaration
    }
  }
}
Image

What minimal configuration is needed to reproduce the bug?

{
  "no-invalid-position-declaration": true
}

How did you run Stylelint?

npx stylelint --allow-empty-input --fix --report-needless-disables '**/*.{css,scss}'

Which Stylelint-related dependencies are you using?

  • stylelint 17.4.0
  • stylelint-config-recommended-scss 17.0.0
  • stylelint-order 7.0.1

What did you expect to happen?

The code is valid and should not output an error.

What actually happened?

Unexpected invalid position declaration (no-invalid-position-declaration)

Do you have a proposal to fix the bug?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: wipis being worked on by someone

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions