csstree / stylelint-validator

Stylelint plugin to validate CSS syntax
MIT License
93 stars 11 forks source link

Compound interpolated expressions throw "Invalid prelude for @media csstree/validator" #52

Open pinkhominid opened 1 year ago

pinkhominid commented 1 year ago

With version 2.1.0, using the postcss-lit custom syntax, compound interpolated expressions like this error

    @media (min-width: 500px) and ${namedMedia.css.mobile} {
        /* ... */
    }

whereas this doesn't

    @media ${namedMedia.css.mobile} {
        /* ... */
    }
rgant commented 11 months ago

I believe that isStandardSyntaxAtRule is now gone from Stylelint@16:

Error: Cannot find module '/.../node_modules/stylelint/lib/utils/isStandardSyntaxAtRule.js'
    at createEsmNotFoundErr (node:internal/modules/cjs/loader:1181:15)
    at finalizeEsmResolution (node:internal/modules/cjs/loader:1169:15)
    at resolveExports (node:internal/modules/cjs/loader:591:14)
    at Module._findPath (node:internal/modules/cjs/loader:668:31)
    at Module._resolveFilename (node:internal/modules/cjs/loader:1130:27)
    at Module._load (node:internal/modules/cjs/loader:985:27)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
    at require (node:internal/modules/helpers:176:18)
    at Object.<anonymous> (.../node_modules/stylelint-csstree-validator/cjs/index.cjs:4:32)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
$ npm list stylelint-csstree-validator stylelint
├─┬ stylelint-csstree-validator@3.0.0 overridden
│ └── stylelint@16.0.2 deduped
└── stylelint@16.0.2

Mentioning this here because in the previous ticket this method was mentioned as the source of my issue. If this should be a new ticket let me know and I will create one.