Fork me on GitHub
#clj-kondo
<
2022-01-24
>
Chris McCormick07:01:40

what would be the best way to lint-as applied-science.js-interop/let as let? a form looks like this:

(j/let [^:js {:keys [velocity position uuid]} b] {:velocity velocity :position position :uuid uuid})
clj-kondo complains about velocity being an unresolved symbol.

Chris McCormick07:01:00

It's not exactly let obviously because of the ^:js thing

borkdude08:01:59

What have you tried? :lint-as clojure.core/let would work I think

Chris McCormick08:01:51

ok let me try again

Chris McCormick08:01:16

ok yes sorry that works. i am probably doing something unclever but i am seeing this for the :lint-as declaration in the require block: > warning: Unresolved namespace applied-science.js-interop. Are you missing a require?

(ns smash.physics
  {:clj-kondo/config {:lint-as {applied-science.js-interop/let clojure.core/let}}}
  (:require
    [sitefox.ui :refer [log]]
    [applied-science.js-interop :as j]
    ["matter-js/build/matter" :as Matter]))

borkdude08:01:53

@chris358 Put a quote in front of the lint-as map

facepalm 1
borkdude08:01:21

so like:

(ns smash.physics
  {:clj-kondo/config '{:lint-as {applied-science.js-interop/let clojure.core/let}}}
  (:require
   [sitefox.ui :refer [log]]
   [applied-science.js-interop :as j]
   ["matter-js/build/matter" :as Matter]))

(j/let [x 1])