I see a cyclic dependency reported (due to :require-macros) in a CLJC file for such ns declaration:
(ns foo.core.util
(:require [clojure.string :as str])
#?(:clj (:import [clojure.lang ExceptionInfo])
:cljs (:require-macros [foo.core.util])))
The code runs fine, so it seems like a buggy flagging on clojure-lsp part. Am I missing something?Yeah, there is a issue that @danilo.silva is taking a look regarding that
if it becomes to hard to fix it we may release a hotfix making it off by default
I've had to turn that linter off in every project so far, which is a shame because I'd love to detect real cyclic dependencies 🙂
We're also seeing false positives — mostly from require calls inside comment forms. We have a dev namespace with depends on everything, which we also use (interactively) from rich comments, triggering cyclic dependency warnings.
Ok, will make a releasing changing the default until we fix it
@teodorlu See https://github.com/clojure-lsp/clojure-lsp/issues/2107 and https://github.com/clojure-lsp/clojure-lsp/issues/2108
Thank you — https://github.com/clojure-lsp/clojure-lsp/issues/2107 is exactly what we're seeing. I agree with your points about :as-alias too.
Ok, release in progress, should be available in a hour
Done
@ericdallo with pretty new linters in clj-kondo I usually release them as off by default or level info. maybe I should tweak some of them to warning now they are more mature but then they are usually left like this ;)
yeah, I actually decided to go with it enabled since we tested on multiple repos at nubank, but it seems it was not enough hehe
clojure-lsp Released clojure-lsp 2025.08.25-14.21.46 disabling by default new cyclic-dependencies linter until corner cases are fixed