Perhaps the best way to write a transpiler so there's no bugs is to write two of them at the same time, i.e. in this case Lua-to-JS and JS-to-Lua. Maybe it's easier to catch bugs.
This mirrors the idea of writing a compiler for a new language in itself as soon as possible.
This mirrors the idea of writing a compiler for a new language in itself as soon as possible.