Skip to content

Finalize clj-kondo hook implmentation and add clj-kondo hook tests for defstyled validation #34

Merged
humorless merged 3 commits intomainfrom
laurence/finalize-clj-kondo-hook
Mar 6, 2026
Merged

Finalize clj-kondo hook implmentation and add clj-kondo hook tests for defstyled validation #34
humorless merged 3 commits intomainfrom
laurence/finalize-clj-kondo-hook

Conversation

@humorless
Copy link
Member

Fixed

defstyled supports using another styled component as the tag argument
(e.g. (defstyled inherited base ...)), but the hook always flagged
non-keyword tags as invalid. Similarly, styled component symbols in
rules (e.g. bold in (defstyled heading :h1 bold :text-3xl)) were
misidentified as the function tail.

Tests added

  • Add end-to-end tests for the clj-kondo defstyled hook, covering both valid and invalid patterns
  • Tests shell out to clj-kondo --lint with EDN output format and assert on ornament/invalid-syntax
    findings

defstyled supports using another styled component as the tag argument
(e.g. `(defstyled inherited base ...)`), but the hook always flagged
non-keyword tags as invalid. Similarly, styled component symbols in
rules (e.g. `bold` in `(defstyled heading :h1 bold :text-3xl)`) were
misidentified as the function tail.

- Track defstyled symbols via atom to validate styled component tags
- Skip token nodes in fn-tag detection to avoid false positives
- Reference symbol tags in output nodes to prevent unresolved warnings
- Remove leftover debug prn calls
@humorless humorless merged commit 63a12f1 into main Mar 6, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant