chat / client / .clj-kondo / config.edn
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
;; clj-kondo config for the sueta (chat) client.
;;
;; The gate is `npm test`'s second link, right after cljfmt: `clojure
;; -M:clj-kondo`. That alias is a version-pinned JVM dependency rather than a
;; native binary, so the gate needs nothing installed on the machine and every
;; machine gets the same answer — verified by running both against this tree
;; and diffing the findings.
;;
;; :lint-as js-await -> let. `shadow.cljs.modern/js-await` is a macro
;; clj-kondo cannot expand, and its `[binding expr]` head really is one let
;; pair — without this line every binding it introduces is an Unresolved
;; symbol, which is essentially the whole no-config baseline (127 errors in the
;; chat tree alone).
;;
;; The `defclass` hook teaches clj-kondo `shadow.cljs.modern/defclass`; its
;; docstring in hooks/defclass.clj records the three details that had to be
;; right. Between them the two entries take this tree from 127 errors to zero.
;;
;; :lint-as promesa.core/let -> let, for the same reason and with the same
;; consequence. `p/let`'s head is a real binding vector, and the :clj-kondo
;; alias lints `src` with :replace-paths [] — so promesa's own exported
;; clj-kondo config (clj-kondo.exports/funcool/promesa in the jar) is never on
;; the path and cannot supply this. Without the line every `p/let` binding in
;; room.cljs is an Unresolved symbol. `p/do` and `p/resolved` need nothing:
;; their arguments are ordinary expressions.
{:lint-as {shadow.cljs.modern/js-await clojure.core/let
           promesa.core/let clojure.core/let}
 :hooks {:analyze-call {shadow.cljs.modern/defclass hooks.defclass/defclass}}
 :linters
 {;; `(str "one string literal")` is real redundancy and the tree has none
  ;; left. Promoted from :info because `--fail-level` only knows :warning and
  ;; :error — an :info finding prints and then exits 0, which is a report, not
  ;; a gate.
  :redundant-str-call {:level :warning}

  ;; NOT missing requires. These two namespaces are named by
  ;; `(shadow.lazy/loadable sueta.room/boot-room)` and
  ;; `(shadow.lazy/loadable sueta.social/attach!)`, which are the app's two
  ;; dynamic module split points (see shadow-cljs.edn `:modules`). Requiring
  ;; them is exactly what must NOT happen: a require would pull `:room` and
  ;; `:social` into the first-paint module and there would be no lazy boundary
  ;; left. shadow resolves the symbol at build time and
  ;; `scripts/build.mjs` gates both boundaries in the emitted output, so this
  ;; is checked — just not by clj-kondo.
  :unresolved-namespace {:exclude [sueta.room sueta.social]}}}

static mirror of HEAD · about · clone: git clone https://git.ardegazu.ro/chat.git