mjavascript / practical-modern-javascript

🏊 Dive into ES6 and the future of JavaScript

Home Page:https://mjavascript.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Inconsistent code style of template literals

sapegin opened this issue · comments

In some places you put spaces inside curly braces:

const message = `The sum of ${ input.join(`+`) } is ${ sum }`

but in others you don’t:

const summary = `${units}x ${name} ($${unitPrice}) = $${totalPrice}`

I'm guessing you wouldn't be up to contribute a fix for this? I prefer spaces everywhere 👍

Any ideas how to automate it and won’t make a lot of mistakes? ;-)

Actually you don’t have a lot of them and most already have spaces. I’ll send a PR ;-)