|
1 | | -{:output {:exclude-files [".*resources/public/js/compiled.*" |
| 1 | +{;; Prevent analysis of compiled CLJS output -- source copies live there |
| 2 | + ;; and cause "redefined var" when IDE analyzes both src/ and compiled/. |
| 3 | + :exclude-files "resources/public/js/compiled" |
| 4 | + :output {:exclude-files [".*resources/public/js/compiled.*" |
2 | 5 | ".*docker/scripts/.*"]} |
3 | | - :linters {:shadowed-fn-param {:level :off} |
4 | | - :shadowed-var {:level :off} |
| 6 | + :linters {;; Enabled at :warning so NEW accidental shadows are caught. |
| 7 | + ;; :exclude covers established patterns: core vars used as param names |
| 8 | + ;; (name, key, type, etc.) and domain terms used as both defs and params |
| 9 | + ;; (level, ability, armor, etc.) across modifier/option/character code. |
| 10 | + :shadowed-fn-param {:level :warning |
| 11 | + :exclude [source character]} |
| 12 | + :shadowed-var {:level :warning |
| 13 | + :exclude [;; clojure.core / cljs.core vars used as parameter names |
| 14 | + name key type val num first last next ns fn comp |
| 15 | + int char chars bytes str time atom ref set class |
| 16 | + list map range min max mod count filter flatten |
| 17 | + keys vals identity ancestors comparator cond |
| 18 | + list? sequential? set? |
| 19 | + ;; re-frame.core/path — used as param in route handlers |
| 20 | + path |
| 21 | + ;; Domain terms used as both ns-level defs and fn params |
| 22 | + ;; in modifiers.cljc, options.cljc, character.cljc, etc. |
| 23 | + level levels level-key ability abilities armor weapon weapons |
| 24 | + action alignment cls equipment size subclass-name |
| 25 | + skill-options skill-expertise tool-options weapon-proficiency-options |
| 26 | + spellcasting-template feat-selections cantrip-selections |
| 27 | + sorted-items selected-plugin-options built-template |
| 28 | + ;; One-off project-var shadows — established code patterns |
| 29 | + ;; where a fn/let binding intentionally shadows its ns def |
| 30 | + actual-path all-armor-inventory app-header |
| 31 | + available-selections builder-page character-summary |
| 32 | + children critical-hit-values custom-equipment entity |
| 33 | + first-class? following-usernames i instant item-adder |
| 34 | + languages levels-selection message mod-cfg mod-key |
| 35 | + name-result parties party-owner prepared-spells-by-class |
| 36 | + prepares-spells query-map search-results source speed |
| 37 | + spells-known style view]} |
| 38 | + ;; 213 warnings. Many namespaces are required purely for side effects: |
| 39 | + ;; re-frame event/sub registrations, modifier macros, spec loading. |
| 40 | + ;; Remaining are test cleanup debt (genuinely unused test requires). |
5 | 41 | :unused-namespace {:level :off} |
| 42 | + ;; 567 warnings. Destructured map bindings used for documentation or |
| 43 | + ;; structure (e.g. {:keys [name level key]} where only some are used |
| 44 | + ;; in the body). Renaming to _ would lose semantic readability. |
6 | 45 | :unused-binding {:level :off} |
7 | 46 | :missing-else-branch {:level :warning} |
8 | 47 | :clojure-lsp/unused-public-var |
|
14 | 53 | orcpub.dnd.e5.options/spell-tags |
15 | 54 | orcpub.dnd.e5.options/potent-spellcasting |
16 | 55 | ;; Live callers exist but LSP can't trace them |
17 | | - orcpub.common/dissoc-in ; events.cljs |
| 56 | + orcpub.common/dissoc-in ; events.cljs:2976 |
18 | 57 | orcpub.dnd.e5.character/add-ability-namespaces ; test |
19 | 58 | ;; Cross-file refs: used in template.cljc but defined in spell_subs.cljs |
20 | 59 | orcpub.dnd.e5.spell-subs/sunlight-sensitivity |
21 | 60 | orcpub.dnd.e5.spell-subs/mask-of-the-wild-mod] |
22 | 61 | ;; re-frame event handlers are dispatched via keyword, not var reference. |
23 | 62 | ;; LSP can't connect reg-event-db registration to (dispatch [:keyword]). |
24 | 63 | :exclude-when-defined-by #{re-frame.core/reg-event-db |
25 | | - re-frame.core/reg-event-fx |
26 | | - re-frame.core/reg-sub |
27 | | - re-frame.core/reg-sub-raw}} |
| 64 | + re-frame.core/reg-event-fx |
| 65 | + re-frame.core/reg-sub |
| 66 | + re-frame.core/reg-sub-raw}} |
28 | 67 | ;; garden.selectors vars are generated by macros (defselector, |
29 | 68 | ;; defpseudoclass, gen-pseudo-class-defs, etc.) at compile time. |
30 | 69 | ;; clj-kondo can't resolve macro-generated vars statically and |
|
34 | 73 | ;; errors.cljc macros behind #?(:clj) reader conditional — |
35 | 74 | ;; one kondo instance can't resolve them |
36 | 75 | orcpub.errors]} |
37 | | - ;; read-string is a valid cljs.core symbol that clj-kondo |
38 | | - ;; doesn't recognize in its ClojureScript analysis data. |
| 76 | + ;; Macros that introduce bindings kondo can't resolve statically. |
| 77 | + ;; Each (ns/macro) entry suppresses unresolved symbols inside that |
| 78 | + ;; macro's body. Modifier macros use defmacro with gensym bindings. |
39 | 79 | :unresolved-symbol |
40 | 80 | {:exclude |
41 | 81 | [read-string |
|
66 | 106 | (orcpub.entity-spec/make-entity) |
67 | 107 | (orcpub.routes-test/with-conn) |
68 | 108 | (orcpub.routes.folder-test/with-conn) |
| 109 | + (orcpub.email-change-test/with-conn) |
69 | 110 | (user/with-db)]}} |
| 111 | + ;; native/cljs and web/cljs are separate source roots; kondo doesn't know |
| 112 | + ;; about them so ns names appear to mismatch their file paths. |
| 113 | + :config-in-ns {orcpub.core {:linters {:namespace-name-mismatch {:level :off}}} |
| 114 | + orcpub.views {:linters {:namespace-name-mismatch {:level :off}}} |
| 115 | + orcpub.dnd.e5.native-views {:linters {:namespace-name-mismatch {:level :off}}}} |
| 116 | + ;; with-conn macros use bare symbol bindings — handled via |
| 117 | + ;; :unresolved-symbol :exclude above (macroexpand hooks can't find |
| 118 | + ;; the test namespaces and produce noisy warnings). |
70 | 119 | :lint-as {reagent.core/with-let clojure.core/let |
71 | 120 | hiccup.def/defhtml clojure.core/defn |
72 | 121 | user/with-db clojure.core/let |
|
0 commit comments