Fork me on GitHub
Noah Bogart03:12:37

One of the things that linters in other language do is give each linter error a unique id so that errors can be easily searched and discovered. Has any thought been given to adding this to clj-kondo?


This can be enabled via config, see docs


On mobile now so can’t give you the link but it’s in

Noah Bogart14:12:39

Thanks. I should have been more specific. Those are good for knowing the name of the linter, but they don't search well unless you're in the linters docs page and use "find in page"


yes, you get an id and you can search. isn't that what you described?

Noah Bogart14:12:45

I'm thinking something like Python's Flake8 rules:


I prefer a name like :unused-binding over E101 to be honest

👍 1
Noah Bogart14:12:57

Here's an example of what I've run into:


So this is more about SEO

Noah Bogart14:12:08

yes. folks in my org have come to me saying, "i'm getting this error and googling it doesn't tell me what's wrong" so i have to say "go to the docs/ file and search it there" which works but is less direct than imo is necessary

Noah Bogart14:12:26

Maybe this is just something that would be helped by having a stand alone clj-kondo website, with a single page per linter. that's a lot of work lol just trying to think through it


well, it's unfortunate that google doesn't find unused binding -> ;)


Maybe we could enable showing the name by default


but this wouldn't solve the SEO problem


Perhaps it would help if we generated an HTML page like this: I'm not sure if it's Github README vs HTML or something else

👍 1
Noah Bogart14:12:17

Yeah, sadly not. This isn't a requirement, of course, for example eslint doesn't use "unique ids" that are letters and numbers (, neither does rubocop (, but those both have stand-alone websites that might help in this regard

Noah Bogart14:12:36

Just in case, I hope I don't sound like I'm demanding you build a whole new website for this, lol. If this is something you're interested in, I'm willing to put in work as well. (For example, from back in September.)


can you do a couple of searches for words in to see if they show up properly in google?


I've done a poll recently about what people prefer: mkdocs material / antora vs the there is now. People vastly preferred the single page that there is now. I've thought about moving clj-kondo docs to asciidoc and then using the same layout (single page). It'd be good to see if this helps SEO too

Noah Bogart14:12:35

each of this points to the book site but doesn't point to the specific part of the page. frustrating


well, at least it shows up


google sometimes does send you to some context on a website right


well, at least you can do ctrl-f after you end up there after google

👍 1

why are .md pages on Github not indexed that well then?


This seems pretty good

👍 1
Noah Bogart14:12:13

i mentioned eslint and rubocop earlier. eslint has specific pages for each rule while rubocop does not. "eslint no-await-in-loop" points to the specific linter page, while "rubocop lint/booleansymbol" points to the "lint cops" page (that contains all of the lint rules)


Well, I think people need at least to know about and to get going and maybe they should just ... read some docs?

👍 1
Noah Bogart14:12:12

seems this is just how google indexes things then, and is not a game we should fall into playing lmao. if it's smart for clj-kondo's workflow to have individual pages then do it, but don't do it merely for the seo

Noah Bogart14:12:53

Agreed. I do think that a "clj-kondo book" like the babashka one would be overall helpful, but I don't think doing more than that is necessary


cool, I was already planning on doing that

Noah Bogart14:12:17

thanks for talking with me about this! i appreciate it

❤️ 1

if you want to help out, feel free to "port" the docs to asciidoc (I used pandoc for this with bb) and then set something up (using the same stuff as babashka, asciidoctor) that generates an HTML page. Only if you want, no pressure

Noah Bogart14:12:00

I'll see if I can scrounge up some time to give that a try! sounds like fun


the babashka book stuff lives here:


but I think for clj-kondo I'd like the docs stuff to just live in the clj-kondo repo itself still


feel free to to put something up in a separate repo


The link to the docs should be shown along with error message :-)


Is this a known issue?: a unused require warning when used in CLJC file and the require is used only on CLJ part of code? I have tried the v2022.12.10 version and still hapens to us.


Just in case, have you tried running clj-kondo without the cache? rm -r .clj-kondo/.cache


Yes, this is standard behavior. if you're only using the namespace in one "target" you should wrap it in a reader conditional.


else it would be quite wasteful to include namespaces in a clojurescript bundle that aren't used right


There is an issue to clarify the message that it only applies to one target


the case is: i have a function that uses a macro in :clj condition but does not uses it on :cljs


I'm not using it in both because the underlying implementation is different, and one raises exceptions and the other no, so this is a legitimate use in my opinion


can you make a full repro, in order for me to understand and give you better help?


in the form of a .cljc file that I can lint locally


If this not makes it clear, I can try to make a little repro


the ex/ignoring is a macro that just ignores exception and returns nil, it is used in one target but not in other


so what happens if you do (:require #?(:clj [ex.ignoring :as ex]))?


you mean include the require also in the condition, hmm, you right, I have not considered it :S


ok, so sorry for this dumb quiestion then. didn't considered this obvious solution


no problem :)