This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
Does clojure-lsp have a linter like :consistent-alias
that works across a project? I want to be able to use clojure-lsp to analyze all of the Clojure files in a project and ensure that they consistently alias a namespace (if they require it)
I think you can use clj-kondo for that, https://github.com/clj-kondo/clj-kondo/blob/master/doc/linters.md#consistent-alias
clojure-lsp uses clj-kondo under the hood, so you could just configure your linter in the clj-kondo settings and clojure-lsp when limiting your project will already consider it
Hello, everone i am using lsp-mode in Emacs with clojure-lsp which as far as i know use clj-kondo under the hood.
But for some reason i dont know why UIX is not recognized and gives unresolved symbols etc. I've already
use the clj-kondo --lint "$(clojure -Spath)" --copy-configs --skip-lint command
to import the clj-kondo, but i still see these
just to double check: does your project/.clj-kondo/
contain the copied config files from uix (https://github.com/pitch-io/uix/blob/master/core/resources/clj-kondo.exports/com.pitch/uix.core/config.edn)?
@U0178V2SLAY I got the this config.edn in project/.clj-kondo and in home .clj-kondo imported but still doesnt work @U04V15CAJ i tried restart lsp-workspace but did not helped. I got no fancy setup just hookup lsp on clojurescript and clojure mode thats it, lsp mode itself seems to work fine. clojure-lsp and clj-kondo is installed.
I guess then something with my clj-kondo is wrong? clojure-lsp --version is --- clojure-lsp 2023.10.30-16.25.41 clj-kondo 2023.10.21-SNAPSHOT
Did you double check what @U0178V2SLAY said?
you don't need to have clj-kondo installed for clojure-lsp since it bundles its own copy of it, the version difference doesn't matter here I think
In Home directory (i thought that would be enough to have it here. And the second screenshot is from project directory.
in fact
~/.clj-kondo
isn't used at all, the global config directory is ~/.config/clj-kondo
if you have uix in your deps.edn
, then lsp will copy those configs on startup (at least, it should)
It is in the deps.edn, but if i remove the .clj-kondo folder which i added by hand and restart everything, there gets no .clj-kondo folder added to the project folder. well i guess something is wrong configured which does not have anything to do with the lsp my best guess 😮 - Thx for the fast answers! 🙂
you should not remove the .clj-kondo
directory, the .clj-kondo
is a sign for clj-kondo where the project root it
just do as follows in your project:
mkdir -p .clj-kondo
clj-kondo --lint "$(clojure -Spath)" --copy-configs --dependencies --skip-lint
can you push this project, including .clj-kondo
directory (without .cache
) to github? then I will have a look
I aprreciate your time, but i guess i already wasted to much time 😮
for my starter project i used the command stated here https://github.com/pitch-io/uix-starter/tree/main
npx create-uix-app@latest my-app # bare-bones project
BUT if i just cloned the git repo the project itself, it seems to work, i guess i just have to compare those now
After doing the npx thing:
$ clj-kondo --lint src/app/core.cljs
linting took 65ms, errors: 0, warnings: 0
borkdude@m1 /tmp/dude/my-app $ clj-kondo --lint "$(clojure -Spath)" --copy-configs --skip-lint
Downloading: com/pitch/uix.core/1.0.1/uix.core-1.0.1.pom from clojars
Downloading: com/pitch/uix.dom/1.0.1/uix.dom-1.0.1.pom from clojars
Downloading: com/pitch/uix.dom/1.0.1/uix.dom-1.0.1.jar from clojars
Downloading: com/pitch/uix.core/1.0.1/uix.core-1.0.1.jar from clojars
Configs copied:
- .clj-kondo/com.pitch/uix.core
linting took 73ms, errors: 0, warnings: 0
borkdude@m1 /tmp/dude/my-app $ clj-kondo --lint src/app/core.cljs
linting took 51ms, errors: 0, warnings: 0
I just pushed to gitlab - https://gitlab.com/ThomasFuston/first It was just to test uix i just try to find why it is not linting
$ clj-kondo --lint src/app/core.cljs
src/app/core.cljs:7:4: error: Unresolved symbol: $
Hmm, i linted from within the sub directory, if i lint from base directory, i do have same output like you
in clojure-lsp, one thing that might be wrong still is the project root. you can try to do `lsp-workspace-remove-folders
uff, thx for your time again ❤️, it is only a minor thing, but i like to have lsp support 🙂 Thx alot!