This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-01-20
Channels
- # adventofcode (8)
- # aleph (2)
- # announcements (10)
- # aws (5)
- # aws-lambda (2)
- # babashka (23)
- # beginners (23)
- # biff (9)
- # calva (4)
- # cider (8)
- # clj-kondo (21)
- # clojure (77)
- # clojure-boston (1)
- # clojure-dev (50)
- # clojure-europe (36)
- # clojure-gamedev (3)
- # clojure-nl (1)
- # clojure-norway (3)
- # clojure-spec (33)
- # clojure-uk (3)
- # clojurescript (22)
- # core-async (3)
- # cursive (10)
- # datahike (18)
- # datalevin (1)
- # datascript (9)
- # deps-new (21)
- # emacs (11)
- # events (1)
- # graphql (11)
- # guix (26)
- # java (7)
- # jobs (3)
- # lsp (12)
- # malli (6)
- # pathom (33)
- # pedestal (3)
- # polylith (15)
- # reagent (5)
- # releases (3)
- # remote-jobs (1)
- # scittle (9)
- # sql (27)
- # tools-build (9)
- # vim (7)
Is it possible to disable a certain type of warning (`unused-binding`) just inside of destructuring a map ?
When I destructure the incoming arguments of an fn
, I often prefer to still give the argument a name using :as
but clj-kondo doesn't like it if I don't use that name anywhere.
@U04V15CAJ I'm sorry - I looked in config but evidently not closely enough. Thank you!
@U07VBK5CJ I'm pretty sure you can prepend the name with a _ and the linter won't complain. No need to change any options if that works for you.
E.g. :as foo
-> :as _foo
I omit :as if it's not going to be used in the code so I'd never disable the linter in projects I'm involved but within a team if other people like it _foo tells me two things: what the map represents and that it's not used :slightly_smiling_face:
@U07VBK5CJ I suggest to use :arglists
meta for documenting function arguments without performance penalty from unneeded destructuring.
but if you're destructuring anyway, then :as x
isn't going to add any performance penalty
I appreciate the feedback too, and I often forget that arglist metadata even exists unless I'm writing macros.
How interested would you be in a linter that yells about syntax quote on namespaced symbols where the namespace isn't an existing alias? I just dealt with a bug where I was trying to implement the Component library using metadata: (with-meta this {
component/start #'start component/stop #'stop})
but I was missing [com.stuartsierra.component :as component]
in my :require
block, so the functions weren't getting called.
cool, I'll write up an issue
@UKFSJSM38 Bump in lsp welcome
I see lsp crashes on the newest clj-kondo but this is because it relies on internals (.impl.config)