compiler option | since v1.7.10 | Edit |
A list of functions that are called when a compiler warning occurs. Defaults to a single function which prints to stderr.
:warning-handlers [...]
A warning handler function receives three args:
warning-type
- a keyword id (one of :warnings
)env
- compiler environment mapextra
- map containing extra data specific to the warningTo make warnings fail the build:
:warning-handlers
[(fn [warning-type env extra]
(when-let [s (cljs.analyzer/error-message warning-type extra)]
(binding [*out* *err*]
(println "WARNING:" (cljs.analyzer/message env s)))
(System/exit 1)))]