@borkdude I just want to say that clj-kondo is amazing. Thank you very much for bringing it up to Clojure 馃檪 I've just configured static typing with #malli & #clj-kondo in Clojurescript for one of the apps based on Rum. Looks awesome! Looking forward to more features in that area!
1馃帀@borkdude One question though 馃槃 I have the following definition
{:lint-as {malli.schema/defn schema.core/defn},
:linters {:type-mismatch
{:namespaces
{view.home-page {usp-banner*
{:arities {1 {:args [{:op :keys, :req {:user-id :number}}],
:ret :any}}},
usp-banner
{:arities {1 {:args [{:op :keys, :req {:user-id :string}}],
:ret :any}}}}}}}}
and invocation:
(defn usp-banner*
[props]
nil)
(defn usp-banner
[props]
(usp-banner {:user-id (:user-id props)})
(usp-banner {:user-id "SomeUserIdAsString")
As for now clj-kondo does no report the type incompatibility. Is there a plan to support it in a future? 馃檪No plans in the immediate future. This is quite hard to do with static analysis without building something like TypeScript
Actually this would be quite powerful. Typescript for Clojurescript via clj-kondo. There is a huge potential in it 馃槃
You may post an issue for this specific example so I can see what can be done realistically
Sure! Thank you very much!
@borkdude One question though 馃槃 I have the following definition
{:lint-as {malli.schema/defn schema.core/defn},
:linters {:type-mismatch
{:namespaces
{view.home-page {usp-banner*
{:arities {1 {:args [{:op :keys, :req {:user-id :number}}],
:ret :any}}},
usp-banner
{:arities {1 {:args [{:op :keys, :req {:user-id :string}}],
:ret :any}}}}}}}}
and invocation:
(defn usp-banner*
[props]
nil)
(defn usp-banner
[props]
(usp-banner {:user-id (:user-id props)})
(usp-banner {:user-id "SomeUserIdAsString")
As for now clj-kondo does no report the type incompatibility. Is there a plan to support it in a future? 馃檪No plans in the immediate future. This is quite hard to do with static analysis without building something like TypeScript
Actually this would be quite powerful. Typescript for Clojurescript via clj-kondo. There is a huge potential in it 馃槃
You may post an issue for this specific example so I can see what can be done realistically
Sure! Thank you very much!
I'm wondering if (next coll)
over (seq (rest coll))
could be a good suggestion candidate for clj-kondo ...
I can't say I've ever seen the latter in code... is that something folks actually do?
(I just searched all the OSS projects I have locally and our 110K line codebase at work)
Well, I know at least one that did it... 馃榿