clj-kondo

skylize 2025-01-04T10:52:32.352769Z

Failing at my attempt to disable :clojure-lsp/unused-public-var across entire project using :config-in-ns. Full config.edn shown in thread.

βœ… 1
skylize 2025-01-04T10:53:49.456179Z

borkdude 2025-01-04T10:55:12.160169Z

if you want to disable this linter, why don't you configure it with:

{:linters {:clojure-lsp/unused-public-var {:level :off}}}
?

skylize 2025-01-04T11:19:47.089379Z

Ah. There we go. Thank you. πŸ‘πŸ»

πŸ‘ 1
nathanmarz 2025-01-04T17:49:42.768469Z

How can I make a custom linter to check for any map literal in the codebase with a particular key in it? e.g. looking for any map with the key :abc in it with a numeric value, like {:x 1 :abc 2}

borkdude 2025-01-05T10:15:36.672329Z

@nathanmarz unfortunately currently there isn't a custom linter for this someone has asked to do this for namespaced keys once I think Since you want to check the value of the key using some dynamic code, it might be worth checking out: https://github.com/borkdude/grasp

nathanmarz 2025-01-05T16:20:57.281079Z

thanks for the pointer

AndrΓ© Camargo 2025-01-07T11:16:43.110999Z

I addressed this issue by linting the maps found within the functions and macros where I expect to find the key I'm interested in. In my case, the key is :required, and people often mistakenly type :require, leading to false positives. To resolve this, I hooked into clojure.core/def, defn, and other functions to check maps for :require and other related keys. So far, I haven't encountered any issues with this approach.

πŸ‘ 2