Closed NoahTheDuke closed 5 days ago
Just tried this out on one of my projects that uses mount
and confirmed that it works better than the existing hook.
Thank you @NoahTheDuke I can confirm. Using the commit with a Calva project setup I no longer see the linting errors
mount/mount {:git/url "https://github.com/tolitius/mount.git"
:git/sha "4065f5df368893dcb4546fd80f573ee9f9226f85"}
@tolitius : Can you please take a look at this PR and consider merging it? Thanks.
it works, thanks ! I removed .clj-kondo directory to force re-download of the clj-kondo imports.
Follow-up to #130, addresses the issue mentioned in https://github.com/tolitius/mount/pull/130#issuecomment-1980554084.
Problem statement
The clj-kondo hook for
defstate
doesn't register the state's symbol as a var, which marks all subsequent usages as unresolved symbols. This is because for(defstate conf :start (load-config))
, it produces the node(fn* [conf] conf :start (load-config))
.Proposed solution
Change the produced node to
(def conf (do :start (load-config)))
.I also added a
.clj-kondo/config.edn
which references the config inresources/
, to make it easier to use in this project. And I moved the hook folder into themount/mount
folder, which helps clj-kondo find it easier and prevents merge-conflicts if a user calls--copy-configs
and multiple projects have definedresources/clj-kondo.exports/hooks
folders.