I ran some compiled Elm JS through ESLint, with no rules enabled. That only checks syntax. And it’s possible to specify the wanted ECMAScript version, which then just checks syntax for that version.
The following sets the version to ES3:
I get this error when running npx eslint path/to/compiled/elm.js:
910:7 error Parsing error: The keyword 'char' is reserved
But when I replace all instances of char with xchar, no errors are reported. So besides a few usages of the name char, the output is syntactically valid ES3 – at least my small example app. I haven’t checked if it actually runs in an ES3 environment though – the code might use some ES5 standard methods.
Setting ecmaVersion": 5 parses the code out of the box. I don’t have a source, but I’m confident the output is valid ES5 at least – that’s from experience. According to Caniuse, IE8 supported only ES3, IE9 partially supported ES5 and IE10 supported ES5 fully. I have never tried Elm code in such old browsers. But I did try it in IE11 back in the day.