You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 14, 2021. It is now read-only.
I'm trying to write an in-house stylelint rule that we want to apply to mixins, e.g.
const mixin = css`
/* Linter rule SHOULD apply here */
`;
but not to styled components, e.g.
const Component = styled.div`
/* Linter rule should NOT apply here */
`;
Basically I want to access the result of isHelper() from within a stylelint rule. One way I could imagine this being implemented is to add another map to index.js (e.g. isHelperMap) and export it, so that in my rule I could run this check:
It shares part of #253. And I don't think another processor should depend on this processor to parse helper names. Maybe a common util package is better.
@chinesedfan I like the approach in #258, but for that to be a solution here I'd need to be able to map different rules to different moduleName/importName settings. E.g. I want most rules to apply to all style blocks, but I want one rule to apply only to css blocks.
And I don't think another processor should depend on this processor to parse helper names. Maybe a common util package is better.
@TrevorBurnham I mistook your in-house rule as another processor. But the conclusion is the same. You'd better distinguish helpers/mixins by your rule itself, instead of depending on this processor.
I'm trying to write an in-house stylelint rule that we want to apply to mixins, e.g.
but not to styled components, e.g.
Basically I want to access the result of
isHelper()
from within a stylelint rule. One way I could imagine this being implemented is to add another map toindex.js
(e.g.isHelperMap
) and export it, so that in my rule I could run this check:It might be even more useful to provide the type of helper in the map, e.g.
"css"
,"keyframes"
, or"injectGlobal"
.The text was updated successfully, but these errors were encountered: