@dnolen Where is that documented? I vaguely recalled that but couldn't see it at https://clojurescript.org/reference/compiler-options
@dominicm wrote about my findings regarding this a whlie ago, not sure if it is still current, but it probably is https://nextjournal.com/kommen/clojurescript-warnings-as-errors
@dominicm huh I guess not yet documented ... :warning-handlers
what's missing is support for this from build config - i.e. a namespaced symbol like in the other cases - that would a be good simple patch
@dnolen That nextjournal article above is exactly what we ran into 😄 Could that find it's way onto the docsite somewhere, either as a guide or as part of the compiler options reference?
@dominicm while that is one possible way, would prefer to fix it so a custom script is not required and doc that instead
@dnolen are you thinking that a built-in warning-handler could be provided, or that the :warnings-as-errors
should be implemented as well as documenting the warning handlers?
there is built in warning handler - and no I'm not interested in a new thing
but we could process :warning-handlers
- if it's a sequence of symbols then resolve them
this is done elsewhere - the goal being that you can avoid writing build scripts
@dnolen oh for sure. The part of the nextjournal guide I was thinking should go into a cljs guide was the particular handler they wrote:
(fn [warning-type env extra]
(when (warning-type cljs.analyzer/*cljs-warnings*)
(throw
(cljs.analyzer/error
env
(cljs.analyzer/error-message warning-type extra)))))
But that could be used alongside symbol resolution!this is an enhancement over what I am suggesting be done first
but I'm also ok w/ it as a separate ticket - i.e. some ns w/ this handler
It is, yep 🙂 Sorry, I'm suggesting multiple things at once around documentation.
@plexus let me know what your bandwidth is for these various macroexpand to require bugs - I can tackle it in the near future if you can't get to it - mostly just checking if you are looking into it
(to avoid duplication of effort)
@dominicm your convo rang a bell, I might have worked on something related eons ago in https://clojure.atlassian.net/plugins/servlet/mobile?originPath=%2Fbrowse%2FCLJS-3074#issue/CLJS-3074?
@lee hey, nice!
I just barely remembered it, hope it helps!