New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for JS functions in plugins
list in Stylelint config
#6452
Comments
@phoenisx Thanks for the proposal. As you commented, I also guess it's possible to implement this feature relatively easily. I'd just like to confirm, what kind of use cases do you have? The following simple case seems to have not much benefit. 🤔 -plugins: ["./plugin-path"],
+plugins: [require("./plugin-path")], |
Hi @ybiquitous! Thanks for the quick reply 🙇🏽
If There's a hack I've been using right now, which seems okay, but would love to see this in-built.
|
@phoenisx Thank you for your explanation. I understand your background well. Also, it's so nice if you have a patch already. Since I believe this addition would not break anything, I've labeled the issue as ready to implement. If anyone has concerns, please feel free to comment. |
Apologies for the delay, was a bit occupied. |
plugins
list in Stylelint configplugins
list in Stylelint config
What is the problem you're trying to solve?
Using
stylelint
as a library in JS (NodeJS/Deno) does not accept JS functions asplugins: []
config values. It only works withstring
type for now.Is it possible to support both?
What solution would you like to see?
Allow developers to, when using
stylelint
as JS library, to pass locally developed stylelint plugins as config param. For e.g.I guess this can be resolved easily if we add a check in
lib/augmentConfig.js#addPluginFunctions
to separatestring
and JS function types asplugins
passed in the config and run the logic accordingly.The text was updated successfully, but these errors were encountered: