clj-kondo exported config
borkdude opened this issue · 4 comments
Hi @weavejester,
Someone in the beginner's channel on Clojurians slack got some clj-kondo warnings from hiccup which can be fixed using configuration:
{:lint-as
{hiccup.def/defelem clj-kondo.lint-as/def-catch-all
hiccup.def/defhtml clj-kondo.lint-as/def-catch-all}}
Would you be willing to "export" this config as part of the hiccup dependency so everyone automatically gets the correct linting when using hiccup as a dependency? This will likely improve the beginner experience for those using hiccup + clj-kondo.
Thanks,
Michiel
Can you explain how to "export" the config? Is it a resource at a known path?
@weavejester I can prepare a PR for this if you want, to not take any of your time. I just wanted to ask first if you would be open to this.
The docs for this are here: https://github.com/clj-kondo/clj-kondo/blob/master/doc/config.md#exporting-and-importing-configuration
Sure, that sounds reasonable.
Wouldn't the :lint-as
version fail whenever you pass a map of attributes to the elem? If so, a custom clj-kondo hook might be necessary, but I don't see an easy way of handling multiple-arity defelem
s due to the way the optional first attribute map argument works.