clj-kondo

Shantanu Kumar 2025-05-28T10:42:07.375419Z

Hi, in vscode/calva (the bundled) clj-kondo is flagging the use of kitchen-async.promise/let (supposed to be treated as clojure.core/let): https://github.com/lambdaisland/fetch?tab=readme-ov-file#lambdaislandfetch - so my question is, how do I configure my project to tell clj-kondo to treat it like a regular let? What should I put in my projects's .clj-kondo dir?

Shantanu Kumar 2025-05-28T10:44:08.363439Z

In a similar case, kitchen-async.promise/catch needs to be treated as a regular catch.

Shantanu Kumar 2025-05-28T10:46:45.445679Z

I both the above cases, clj-kondo flags it for unresolved symbol.

Shantanu Kumar 2025-05-28T11:20:45.207189Z

By following calva visual cues, I was able to get clj-kondo to treat as let by putting {:lint-as {kitchen-async.promise/let clojure.core/let}} in .clj-kondo/config.edn, but the catch needed a #_{:clj-kondo/ignore [:unresolved-symbol]} form in the file.

2025-05-28T14:37:05.950089Z

The easiest way to support catch is with a :macroexpand hook. https://github.com/clj-kondo/clj-kondo/blob/master/doc/hooks.md#macroexpand

🙏🏽 1
2025-05-28T14:37:46.752219Z

Expand it to something like (catch Exception e body..) => (fn [e] (do body...))

2025-05-28T14:39:19.952489Z

See :analyze-call hooks for more accurate line numbers in linter errors.

borkdude 2025-05-28T21:54:33.487639Z

@kumarshantanu I don't know kitchen-async that well, but it looks similar to promesa: https://github.com/funcool/promesa promesa has a built-in clj-kondo config for all of it's macros. you could either switch to this library or more or less copy the configuration (preferably to kitchen async so everybody profits)

👍🏽 1