clj-kondo

2024-08-13T10:29:49.550579Z

would it be hard to create a custom linter rule to check that a given function can only be called with nil as first argument?

Stig Brautaset 2024-08-13T10:41:44.072949Z

Dunno, I've never written a linter. But I'm now nerd-sniped and super curious what the use case is 😅

2024-08-13T10:59:43.936719Z

well, it's a function called with-error in lacinia, if you pass a value and an error at the same time you end with kind of broken graphql responses

2024-08-13T11:00:07.269019Z

and the errors get dropped if your server is behind something like apollo or graphql-mesh

2024-08-13T11:00:18.192819Z

but lacinia lets you happily do that

2024-08-13T11:00:49.082439Z

we already fixed the problem, but would be good to make sure someone doesn't do that again in the future by mistake

Kirill Chernyshov 2024-08-13T11:07:35.884349Z

you can use malli to generate linter rules for that https://github.com/metosin/malli?tab=readme-ov-file#clj-kondo

âž• 1
Kirill Chernyshov 2024-08-13T11:09:58.340169Z

there is also an example how to use :type-mismatch linter if you don't want to use malli

2024-08-13T11:40:08.924369Z

ah nice