jfmengels / node-elm-review

CLI for elm-review
https://package.elm-lang.org/packages/jfmengels/elm-review/latest/
BSD 3-Clause "New" or "Revised" License
48 stars 25 forks source link

Typecheck Elm templates #194

Open lishaduck opened 2 months ago

lishaduck commented 2 months ago

Currently, there's just a bunch of string templates. We should run elm make --output=/dev/null over them to make it typesafe.

jfmengels commented 2 months ago

Are you talking about the string templates in the new-rule.js file? Did you see any others?

Anyway, I think it's fine as it is. The templating is very minimal so it's IMO very readable and easy to change. Adding elm-codegen would add dependencies, would likely be slower and would add dependencies.

I think if it's about type safety, then we can run elm make/elm-test on the generated files in our test suite, and that would give us the same guarantees.

lishaduck commented 2 months ago

Are you talking about the string templates in the new-rule.js file? Did you see any others?

I thought I saw some in new-package, might be wrong.

Anyway, I think it's fine as it is. The templating is very minimal so it's IMO very readable and easy to change. Adding elm-codegen would add dependencies, would likely be slower and would add dependencies.

Fair.

I think if it's about type safety, then we can run elm make/elm-test on the generated files in our test suite, and that would give us the same guarantees.

That's the real issue. I just don't want a typo to go unnoticed.