clj-kondo

Eric Dvorsak 2025-06-02T16:59:35.814999Z

(require '[malli.experimental :as mx])

(mx/defn test-closed
  [{:keys [potato]} :- [:map
                        {:closed true}
                        [:potato {:optional true} :string]
                        [:carrot :string]]]
  potato)

(test-closed {:potatoe "there is a typo" :carrot "no typo"})
Is this a clj-kondo issue or a malli issue that the fact that :potato key shouldn't be there is not reported as a linting error, but if I remove the optional true it correctly reports :potato as missing

borkdude 2025-06-02T17:01:32.954109Z

@yenda1 clj-kondo doesn't support the idea of closed-ness I think

Eric Dvorsak 2025-06-02T17:07:47.471819Z

is it something that would be fundamentally against it or can I open a feature request? I've found that combo of malli instrumentation and clj-kondo linting to be amazing in practice, here the specific use case is to catch typos in UI components that take optional props

borkdude 2025-06-02T17:09:58.446919Z

There's an open issue for it (just found it): https://github.com/clj-kondo/clj-kondo/issues/2237 Please upvote it