Fork me on GitHub
#clj-kondo
<
2020-01-14
>
avi14:01:35

Sorry if this is a FAQ, but kondo always produces unresolved symbol errors when I open up my deps.edn file in my editor. Is there a known workaround for this? Or a plan to change it? I don’t quite understand the behavior, given that the EDN spec says symbols are valid in EDN files, and AFAIK there’s no way within the file to provide a way for the symbols to be resolved…

borkdude14:01:37

does it also happen when you lint the file from the command line?

avi14:01:00

checking…

avi14:01:51

(I’m using Atom with linter-kondo)

borkdude14:01:55

maybe linter-kondo doesn't pass the right --lang argument when it lints a .edn file. It should pass --lang edn

avi14:01:26

ah, OK, I’ll take a look. Thanks!

avi15:01:14

it doesn’t look like it’s passing --lang at all…

avi15:01:32

which from my CLI testing, I would think, should not yield errors?

avi15:01:47

$ clj-kondo --lint deps.edn 
linting took 18ms, errors: 0, warnings: 0

borkdude15:01:35

it passes the text via stdin, so clj-kondo doesn't know the filename. so it cannot know if your code is edn, clj, cljs etc

borkdude15:01:42

this is what the --lang flag is for

avi15:01:23

aha, so I need to add --lang to the plugin. OK, I’ll give that a try. Thanks!

borkdude15:01:45

yeah which is basically just the file extension

👍 4
avi20:01:44

… I opened a PR: https://github.com/gerred/linter-kondo/pull/2 — it might even work! (I haven’t tested it 😬 😅)