board / 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
;; clj-kondo config for the board 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 {shadow.cljs.modern/js-await 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 board.board/boot-board)` and
  ;; `(shadow.lazy/loadable board.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 `:board` 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 [board.board board.social]}}}

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