:warning-handlers

compiler optionsince v1.7.10Edit

A list of functions that are called when a compiler warning occurs. Defaults to a single function which prints to stderr.

:warning-handlers [...]

Details:

A warning handler function receives three args:

  • warning-type - a keyword id (one of :warnings)
  • env - compiler environment map
  • extra - map containing extra data specific to the warning

Examples:

To 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)))]

See Also: