Tidy editor code to pass jshint