This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-29
Channels
- # announcements (2)
- # babashka (18)
- # beginners (42)
- # calva (56)
- # chlorine-clover (35)
- # clara (9)
- # clj-http (1)
- # clj-kondo (19)
- # cljs-dev (8)
- # clojure (14)
- # clojure-europe (23)
- # clojure-france (7)
- # clojure-norway (6)
- # clojure-uk (3)
- # clojurescript (37)
- # community-development (3)
- # cursive (29)
- # datomic (3)
- # emacs (10)
- # events (2)
- # fulcro (77)
- # hyperfiddle (2)
- # introduce-yourself (4)
- # joker (1)
- # lsp (40)
- # malli (52)
- # meander (7)
- # missionary (16)
- # off-topic (3)
- # pedestal (1)
- # re-frame (5)
- # reitit (38)
- # releases (1)
- # shadow-cljs (4)
- # tools-build (18)
- # tools-deps (1)
- # xtdb (8)
I have a line of code (let [path (.getPath ^object app "userData")]
where clj-konda says Unresolved symbol: object
. I believe, and correct me if I'm wrong, that object
here is the javascript class named object
. (The source file is a .cljs file) How can I get clj-kondo to understand that?
Code context, if needed: https://github.com/logseq/logseq/blob/59fde1b41fd91bc84b8c1040823182ef627b4b18/src/electron/electron/handler.cljs#L252
Shouldn't that be ^Object
?
I really don't know. I'm new to the codebase, and hoping to help by starting small and doing a little linting. 😕 I'm not sure what else object
would be in this case. It's not shown in the require at the top of the file.
Now, this object
usage is only occurring in .cljs files within the src/electron/electron
folder of the codebase. Maybe object
is an electron thing?
Yeah, just looking over that code I suspect you're right but clj-kondo doesn't know how to find it...?
That's correct. I'm getting Unresolved symbol: object
Interesting. Here, line 72 clj-kondo resolves object
fine, or at least doesn't flag an error. But it does flag an error on line 76: https://github.com/logseq/logseq/blob/master/src/electron/electron/search.cljs#L72
(Same error: Unresolved symbol: object
)
Seeing it work on line 72 here, but not line 76, makes me think it might be a bug in clj-kondo, regardless of what object
is in this case. But I am pretty new at all this, so I might be misunderstanding the syntax.
I confirmed I can replace object
with my name on line 72, and I won't get an error
So that indicates clj-kondo is just ignoring the context of the type hint in line 72...
@borkdude What do you think of adding a clj-kondo warning for unsafe usage of read-string
(that could be exploited to execute arbitrary code)?
There is an issue for more general linter for this where you can configure read-string: https://github.com/clj-kondo/clj-kondo/issues/996 Feel free to upvote the issue with a thumbs up
Cursive users take note! @brcosta has been doing amazing work on integrating clj-kondo with Cursive. See these screenshots! You can try out this plugin by going to preferences > plugins > install from disk https://www.dropbox.com/s/uo6fiquyowa6qe0/clj-stuff-plugin-0.3.0.zip?dl=0 It will likely be renamed to a better name and available in the marketplace within a few days.


Cool. What's the difference from the previous clj-kondo integration? Looks like an IntelliJ plugin. Is the source code available online?
@U083D6HK9 The source code is here: https://github.com/brcosta/clj-stuff-plugin The difference is that this is likely more performant, and less work to set up, but I'll defer to @brcosta for better info on this.