Stylelint 14 rules do not work because during traversal, node parent lang
is undefined and not template-literal
#1266
Labels
bug report 🦗
Issue is probably a bug, but it needs to be checked
needs: complete repro 🖥️
Issue need to have complete repro provided
needs: triage 🏷
Issue needs to be checked and prioritized
Environment
Stylelint config:
Description
I integrated stylelint into our Linaria project, yet figured that most of the rules do not work. e.g.
property-no-unknown
doesn't report unknown properties, yetstring-quotes
worked.Considering I couldn't figure what's wrong, I literally debugged the
property-no-unknown
rule in Stylelint. This pointed me to this line in one of the checks: https://github.com/stylelint/stylelint/blob/main/lib/rules/property-no-unknown/index.js#L64Yet the "parent" of my unknown property was the actual wrapping TS file my Linaria declaration is present in. e.g. if this is the traversed declaration in
test.ts
:Then the parent became:
Considering this is no CSS, stylelint fails to recognize this is CSS hence the check passes.
I guess I'm doing something wrong, but can't figure what. I thought it's related to PostCSS missing as an actual dependency, but even after installing it the rules fail to work.
The text was updated successfully, but these errors were encountered: