stil4m / elm-syntax

Elm syntax in Elm
MIT License
94 stars 28 forks source link

ports in a non-port module is considered valid #234

Open jfmengels opened 3 months ago

jfmengels commented 3 months ago

Currently, ports within a non-port module is considered valid, but that is an error in Elm.

module Main exposing (p)

port p : () -> Cmd msg

(Ellie: https://ellie-app.com/rMMpDDbbw4Qa1)

I wonder whether this should be considered kind of like a syntax error. I'd say so, but I'm not entirely sure.

I don't know if we should have similar checks for effect modules, I don't know them enough.

lue-bird commented 2 months ago

I also think this should be a syntax error.

And in the same way we should (?) report if a port module does not contain any ports.