Remove clj-kondo config output for cljs schemas #662
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have been trying this out and unfortunately realized that kondo support will not be so simple.
If the cljs schemas use vars that are only available during the cljs runtime
we do not have access to them during macroexpansion and thus will cause exceptions.
This line
malli/src/malli/clj_kondo.cljc
Line 161 in 303c606
will attempt to construct a malli schema and if there any symbols that represent clojurescript variables then there is no way to know their values in clojure.
For now I think removing the kondo support makes sense to allow the instrumentation to work.
As an alternative, we could potentially add clojurescript code that will print out the kondo config to the javascript console when all the vars are available and the user can copy it to the condo config file. I know it's not a great solution but at least provides some value.
update: I added a printer helper for cljs.