Fork me on GitHub

idea: inspection that warns about a function definition without ! at the end of the name that includes a call to a function with ! at the end of the name in the body

❤️ 4

I don't think ! has a consistent meaning in Clojure.


Also, it's possible for a function to be pure even though it mutates things. e.g. a function which uses transients for performance but returns the persistent collection.

👍 4

ah, that is a good point


idea: warn when two files require a namespace with different aliases?

🙂 4

I've mentioned this a few times, I have a plan to write something that will rewrite your project into consistency automatically


I want a few other pieces in place first, namely alignment of forms needs careful preservation. Doing research into that now :)

Adrian Smith21:01:23

Is there an exception for js/ in cljs?


@eraserhd That feature is already in clj-kondo: Although you have to decide on one accepted alias using the config before you get a warning. The analysis output can also help to detect difference and to create the initial config.


@sfyire Are you sure that's not a cljc file? Can't reproduce it.

Adrian Smith21:01:49

@borkdude oh weird I get it for using atom and the linter-kondo plugin (inside core.cljs)


@aviflax was going to do a PR to fix this I believe. it's doesn't pass the --lang flag so clj-kondo doesn't know this is cljs


it seems the commit is already in there, so maybe try upgrading the plugin @sfyire?


or maybe it hasn't been released yet. anyway, that's the issue

Adrian Smith21:01:20

@borkdude oh I see that might be why I don't see that error in cursive, looks like they haven't tagged up a release yet in linter-kondo, good to know it's incoming though


might be worth asking the maintainer(s) directly


PR me! 🙂 I'm underwater with work right now.


or open an issue and I can look in the next few days


one sec, on a call then I'll review. do I need to cut a release?


@gerred avi mentioned: > but first one of us should test this change in the last comment of that issue. 🙂


maybe there's also a way for people to build the plugin locally to test it out

Adrian Smith22:01:37

I have an example of a failing test case but not sure how to build the plugin locally, will do some googling

Adrian Smith22:01:06

ok so I've uninstalled the existing plugin, done git clone ~/.atom/package/linter-kondo/ and I can see the plugin in atom's list

Adrian Smith22:01:32

now there's no error but also don't see anything when adding (inc "test") so I think I may have done something wrong

Adrian Smith22:01:40

I did see other people talking about using apm link

Adrian Smith22:01:16

ah figured out why, I usually disable toasts but it does hide important stuff:


maybe someone in the #atom-editor channel knows how to build such a thing?

Adrian Smith22:01:53

this isn't a bug in the linter it's something I've done to try and load it in dev mode


oh, only 16 people there


good luck, I'm afk now

👍 4
Adrian Smith22:01:23

ok I've figured out a couple of things, the above error I needed to npm i but I'm still not seeing anything when I console log that line I get:

Adrian Smith22:01:21

looks like clj-kondo expects cljs instead of .cljs for that argument, I've "fixed" that locally but that doesn't appear to have fixed it


it's supposed to be --lint - --lang cljs so it's also the wrong order

Adrian Smith22:01:51

good spot that's working in a local hack


@sfyire thank you! Still on this call :face_with_rolling_eyes: then I'll look and merge, and throw you a commit bit.


Ah, sorry… I meant to look into how to test that change but I haven’t gotten around to it