Liking cljdoc? Tell your friends :D

Editor integration

Before setting up your editor, see Project setup on how to configure clj-kondo for your project. TL;DR: this involves creating a .clj-kondo directory in the root of your project.

Emacs

For integrating with Emacs, see flycheck-clj-kondo.

For Spacemacs, check here.

Visual Studio Code

In Visual Studio Code, go to Preferences > Extensions. Search for 'clojure lint' and select the 'Clojure Lint' extension by @marcomorain. Click 'install'. That's it.

Vim / Neovim

This section is for Vim 8+ or Neovim.

  1. Install ALE using your favorite plugin manager. This already has in-built support for clj-kondo.

  2. In your .vimrc, add:

    let g:ale_linters = {'clojure': ['clj-kondo']}
    

    to only have clj-kondo as the linter.

    To enable both clj-kondo and joker, add:

    let g:ale_linters = {'clojure': ['clj-kondo', 'joker']}
    
  3. Reload your .vimrc and it should start working.

IntelliJ IDEA

This section assumes that you are already using Cursive.

  1. Install the File Watchers plugin.

Repeat the below steps for the file types Clojure (.clj), ClojureScript (.cljs) and CLJC (.cljc).

  1. Under Preferences / Tools / File Watchers click + and choose the <custom> template.
  2. Choose a name. E.g. clj-kondo <filetype> (where <filetype> is one of Clojure, ClojureScript or CLJC).
  3. In the File type field, choose the correct filetype.
  4. In the Program field, type clj-kondo.
  5. In the Arguments field, type --lint $FilePath$ --cache.
  6. In the Working directory field, type $FileDir$.
  7. Enable Create output file from stdout
  8. In output filters put $FILE_PATH$:$LINE$:$COLUMN$: $MESSAGE$.

Spacemacs

Ensure that:

  1. syntax-checking is present in dotspacemacs-configuration-layers.
  2. clj-kondo is available on PATH.

In the .spacemacs file:

  1. In dotspacemacs-additional-packages add flycheck-clj-kondo.

  2. In the dotspacemacs/user-config function add the following:

    (use-package clojure-mode
     :ensure t
     :config
     (require 'flycheck-clj-kondo))
    

To install it alongside joker:

  1. In dotspacemacs-additional-packages add flycheck-clj-kondo and flycheck-joker.

  2. In the dotspacemacs/user-config function add the following:

    (use-package clojure-mode
     :ensure t
     :config
     (require 'flycheck-joker)
     (require 'flycheck-clj-kondo)
     (dolist (checker '(clj-kondo-clj clj-kondo-cljs clj-kondo-cljc clj-kondo-edn))
       (setq flycheck-checkers (cons checker (delq checker flycheck-checkers))))
     (dolist (checkers '((clj-kondo-clj . clojure-joker)
                         (clj-kondo-cljs . clojurescript-joker)
                         (clj-kondo-cljc . clojure-joker)
                         (clj-kondo-edn . edn-joker)))
       (flycheck-add-next-checker (car checkers) (cons 'error (cdr checkers)))))
    

Reload the config to enable clj-kondo.

Can you improve this documentation? These fine people already did:
Michiel Borkent & Rahul De
Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close