Fork me on GitHub
Chad kennedy03:12:33

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?


Shouldn't that be ^Object?

Chad kennedy03:12:20

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.

Chad kennedy03:12:44

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...?

Chad kennedy03:12:31

That's correct. I'm getting Unresolved symbol: object

Chad kennedy03:12:36

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:

Chad kennedy03:12:10

(Same error: Unresolved symbol: object)

Chad kennedy04:12:42

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.

Chad kennedy04:12:38

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...


Issue welcome

Yehonathan Sharvit13:12:37

@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: 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 It will likely be renamed to a better name and available in the marketplace within a few days.

🎉 3
🚀 1
cursive 1
clj-kondo 1

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: 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.


Hey guys! Yes, zero-conf, more performant and now we can make clj-kondo more tightly integrated with Intellij 🙂