I think Elm has some of the best engineering around that: http://elm-lang.org/blog/compiler-errors-for-humans and http://elm-lang.org/blog/compilers-as-assistants
While it's also not perfect or can correctly identify all possible syntax/intent errors, it's a valuable tool to learn the language nonetheless.