This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-01-29
Channels
- # babashka (4)
- # babashka-sci-dev (96)
- # beginners (79)
- # calva (26)
- # cider (5)
- # clerk (2)
- # clj-kondo (23)
- # clojars (14)
- # clojure (54)
- # clojure-europe (8)
- # clojure-sweden (3)
- # clojurescript (76)
- # datomic (12)
- # deps-new (6)
- # emacs (20)
- # events (3)
- # exercism (1)
- # fulcro (11)
- # funcool (12)
- # hugsql (14)
- # hyperfiddle (6)
- # kaocha (1)
- # lambdaisland (1)
- # lsp (22)
- # malli (1)
- # matcher-combinators (6)
- # nbb (6)
- # off-topic (128)
- # polylith (14)
- # re-frame (4)
- # reagent (1)
- # releases (4)
- # shadow-cljs (8)
- # tools-build (13)
- # tools-deps (13)
- # tree-sitter (5)
The following code seems to be checked by flycheck incorrectly
(ns
(:require [mithril :as m]))
(def my-pictures #js {:view (
fn [] (m "div" #js {:class "container"}
(m "article" (
(m "h1" #js {:role "button"} "my name")
(m "h2" "My Pictures")))))})
This is merely a convention, but helpful to let clj-kondo know this is a JS library and you can use the namespace name as a function
ty, I checked and added it. Oddly, it still has the issue. The following with the same structure does not produce the error
(def my-pictures #js {:view (fn []
(m "div" #js {:class "container"}
(m "article"
(m "h1" #js {:role "button"} "my name")
(m "h2" "My Pictures"))))}))
Figured it out
There was an extra paren there
Should be fixed
error unresolved symbol m at line 12 (m h1)
Seems to have been a combination of "mithril" needing to be defined in string (js libraries indicated with string lib name) and extra paren. had bracket in wrong part of the namespace as well. not sure how it managed to have been compiling correctly thus far
why would clj-kondo complain about unresolved symbols on in arg lists? I think it doesn't like my fn
and friends
added .clj-kondo/config.edn
with this:
{:lint-as {core/fn clojure.core/fn
core/defn clojure.core/defn
core/let clojure.core/let
core/defmacro clojure.core/defmacro
core/loop clojure.core/loop
core/declare clojure.core/declare
core/defn- clojure.core/defn-
core/def- clojure.core/def-
core/when-let clojure.core/when-let
core/if-let clojure.core/if-let}
:linters
{:redefined-var
{:level :off}
:unresolved-symbol
{:exclude [set-macro! apply* parse-int gt lt]}}}
and it seems like it cured all squiggly lines across my codebase 😂