helix

Bryce Tichit 2021-09-22T09:53:00.126600Z

Hello, I started to use Helix last week, the library is amazing ! Anyone know if it's already possible to make emmet output Helix code?

Bryce Tichit 2021-09-22T09:53:27.127100Z

I'd write the CSS in Emmet for example and it'd output Helix form corresponding to the HTML

lilactown 2021-09-22T13:53:44.127700Z

hmm I don't know of a way of doing that. is there an example of emmet outputting other CLJS code? e.g. reagent?

Bryce Tichit 2021-09-22T20:06:19.129Z

I don't know, just had the idea. It's straight forward to transform html into Helix Dom Functions Tree so technically should be possible to just output the HTML with Emmet and then translate HTML to Helix

Bryce Tichit 2021-09-22T20:06:36.129400Z

At least programatically it's possible, then we'd need to implement it in an editor

Bryce Tichit 2021-09-22T20:06:45.129700Z

But yeah maybe it's not straight forward

Bryce Tichit 2021-09-22T20:07:20.130400Z

I have another question as well, do you know how to configure clj-kondo so he understand that defnc is actually a defn ?

Bryce Tichit 2021-09-23T07:19:09.133500Z

Thanks a lot it's working now 😄

Bryce Tichit 2021-09-22T20:34:32.130800Z

Thanks a lot ! Read that already but was too tired looks like 😞 I cannot really figure out how I can config clj-kondo with the lint-as option, just switched to NeoVim and I think that CoC should be the plugin the manages kondo. So would be there for me, still looking !

Bryce Tichit 2021-09-22T20:35:30.131Z

Or maybe I should specify it in the source code?

Bryce Tichit 2021-09-22T20:35:35.131200Z

With the linter annotations

Bryce Tichit 2021-09-22T20:39:22.131400Z

bryce@evolution ~/p/tailwind_cljs (master)> tree .clj-kondo/
.clj-kondo/
└── lilactown
    └── helix
        └── config.edn

bryce@evolution ~/p/tailwind_cljs (master)> bat .clj-kondo/lilactown/helix/config.edn 
───────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: .clj-kondo/lilactown/helix/config.edn
───────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ {:lint-as {helix.core/defnc clojure.core/defn
   2   │            helix.core/defhook clojure.core/defn
   3   │            helix.core/fnc clojure.core/fn}}
Looks like the configuration is already there but clj-kondo does not recognize it, maybe I need to change some settings

Bryce Tichit 2021-09-22T20:47:42.131600Z

No problem when I feed in the config file directly

bryce@evolution ~/p/tailwind_cljs (master)> clj-kondo --config ./.clj-kondo/lilactown/helix/config.edn --lint src/main/app/index.cljs
linting took 49ms, errors: 0, warnings: 0
But it does not understand it when the clj-kondo config dir is supplied, here is an example where I force the config dir
bryce@evolution ~/p/tailwind_cljs (master)> clj-kondo --config-dir ./.clj-kondo --lint src/main/app/index.cljs
src/main/app/index.cljs:7:8: error: Unresolved symbol: Card
src/main/app/index.cljs:7:22: error: Unresolved symbol: span
src/main/app/index.cljs:7:27: error: Unresolved symbol: header
src/main/app/index.cljs:7:34: error: Unresolved symbol: desc
src/main/app/index.cljs:17:8: error: Unresolved symbol: App
linting took 43ms, errors: 5, warnings: 0
It does not understand there that defnc should be linted like defn

dominicm 2021-09-22T20:56:09.132Z

There's a clj-kondo command to run, which will pull in all the kondo configs from your dependencies.

dominicm 2021-09-22T20:56:32.132200Z

clj-kondo --lint "<classpath>" --dependencies --parallel --copy-configs

Bryce Tichit 2021-09-22T21:24:08.132400Z

Thanks. But this should actually output the configuration in .clj-kondo nope? For Helix the configuration is already in .clj-kondo

dominicm 2021-09-22T21:24:42.132600Z

But it's on the classpath, not in your .clj-kondo.

Bryce Tichit 2021-09-22T21:44:00.132800Z

Not sure if I understand correctly, sorry new to Clojure 😛

Bryce Tichit 2021-09-22T21:44:38.133Z

classpath just means the source nope? I linted the sources as adviced and with the good options but still nothing. For sure I'm missing something

lilactown 2021-09-22T23:51:53.133200Z

@tichit.bryce you need to make sure you're linking them correctly to your main config.edn. see https://github.com/clj-kondo/config/blob/master/rum/.clj-kondo/config.edn as an example

✅ 1