Closed ElPrudi closed 1 year ago
Thanks! Just fixed both: message
and @putout/plugin-simplify-ternary
🎉. Please re-install 🐊. Is it works for you?
Yes, the error doesn't appear anymore. But the message you committed is broken English. Try more the lines of:
throw Error(`☝️ Looks like you tried to put a Statement in place of an Expression. Use 'match' to filter out such cases: '${print(nodeFrom, PRINT_OPTIONS)} -> ${print(nodeTo, PRINT_OPTIONS)}'. For code: '${path}'`);
I'd highly suggest that you run deepl to translate all of your error messages to your native language and back. It's pretty reliable and that's how I learned how to write in English.
I'm still closing this issue as the error doesn't appear anymore.
I used Looks like a try
instead of Looks like you try
, because this is definitely not you trying to do something incorrect, this is a case not handled by plugin that can produce incorrect result.
Anyways, thank you!
I don't know what this error tells me
Don't know hot much it would be useful 😅, but you can read about difference between Expression and Statement int the Book Of AST😏.
I don't know what this error tells me, but it seems putout doesn't deeply check returned assignments (
return (x = 5)
).While it can handle this:
It fails when you want to do something more complex: