Closed lue-bird closed 2 years ago
I think the proposal in my comment in https://github.com/jfmengels/elm-review/issues/121#issuecomment-1129284921 would be a better way to solve the itch.
Closing this issue seeing as @lue-bird also agrees that my proposal would fit better.
Including
TypeAnnotation
visitors would be useful to for example forbid tuple types, specific named types, ...:Review.Rule.withSimpleType(Annotation)Visitor
Review.Rule.withType(Annotation)EnterVisitor
Review.Rule.withType(Annotation)ExitVisitor
(I'm in favor of
Type
as opposed to annotation which would imply top-level, not stepping deep inside; Only downside I can see is an unlikely confusion with a tagged union declaration)It is currently quite a lot of code and therefore error-prone. Maybe the code I wrote can help with the implementation just a little :shrug::