Skip to content

False positive using ancestor pseudo-class (vue-scoped-css/require-selector-used-inside) #433

@GrantGryczan

Description

@GrantGryczan

Minimal reproduction: https://play.vuejs.org/#eNp9kTFPwzAQhf+KdRNIVToglhAqAaoEDICA0UvkHG2KY1u+Swiq8t85u2rpUHWz3/ve6Z29hbsQiqFHKKFi7IKtGRfaKVU17aCMrYluNTASa1g8orW+mosjSDU/4uVK/GtRkfEBG1HKdU0XQl6qIqXVNg013vpYqojNjXZTmpFTgsMMWLLuq10VG/JO+uSEBuO70FqMr4Fb70hDuZuVvFr6/DxnjWOPs71u1mi+T+gbGpOm4S0iYRxQw8HjOq5Qtkz28uMFRzkfzM43vRX6jPmO5G2fOu6w+941UvuIy22fuuAjt271ScuR0dF+qVQ0kVPmNcinPJxZ/b/uVXGdc/KiMP0B8reZ3Q==

This results in the following ESLint output, highlighting the space between :has(div) and .test:

  6:10  warning  The selector ` ` is unused in the template    vue-scoped-css/require-selector-used-inside

This is nonsensical, because is not a selector. If this is supposed to give a warning, the warning message is unclear. Notably, this warning goes away when wrapping the div in another element, which is not consistent with the behavior of the CSS: the selector is used with or without a wrapping element.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs reproNeed a repository that can reproduce the problem

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions