coderaiser / putout

🐊 Pluggable and configurable JavaScript Linter, code transformer and formatter, drop-in ESLint superpower replacement 💪 with built-in support for js, jsx, typescript, flow, markdown, yaml and json. Write declarative codemods in a simplest possible way 😏
https://putout.cloudcmd.io/
MIT License
698 stars 40 forks source link

[printer] [bug] #194

Closed grayflow closed 8 months ago

grayflow commented 9 months ago
code = 'if (e.indexTheme) var c = e.theme + (e.level + 10 * e.indexTheme) + ")"; else c = e.theme + e.level + ")";'
'if (e.indexTheme) var c = e.theme + (e.level + 10 * e.indexTheme) + ")"; else c = e.theme + e.level + ")";'
> console.log(putout(code).code)
if (e.indexTheme)
var c = e.theme + (e.level + 10 * e.indexTheme) + ')'else
    c = e.theme + e.level + ')';
> eval(putout(code).code)
Uncaught SyntaxError: Unexpected token 'else'
coderaiser commented 9 months ago

Thanks! Just, fixed 🎉! Please re-install 🐊Putout. Is it works for you?

Could you please tell me why you use such code?

if (a)
    var b;
coderaiser commented 8 months ago

Closed due to a long time of inactivity 🏝