Use template literals instead of string concatenation#3066
Use template literals instead of string concatenation#3066rejas merged 5 commits intoMagicMirrorOrg:developfrom
Conversation
We have used it inconsistently so far. Template literals are more modern and usually easier to read. https://eslint.org/docs/latest/rules/prefer-template
|
Good PR. I would vote for adding the rule to the eslint config and add one "// disable" exception to the line in the newsfeed module. That way we stay "modern" and can fix the line maybe later :-) |
rejas
left a comment
There was a problem hiding this comment.
add rule to eslintrc and add exception to the one line in newsfeed module
It is already included in "plugin:prettier/recommended".
|
I just did the following:
|
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## develop #3066 +/- ##
===========================================
+ Coverage 23.02% 23.13% +0.10%
===========================================
Files 52 52
Lines 11582 11566 -16
===========================================
+ Hits 2667 2676 +9
+ Misses 8915 8890 -25
... and 1 file with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
We have used it inconsistently till now. Template literals are more modern and easier to maintain in my opinion.
Because that's a large amount of changes, here's a way to reproduce it: I added the rule
"prefer-template": "error"to the.eslintrc.jsonand did an autofix. Since this caused a new problem in line 409 ofnewsfeed.js, I reversed it in that line and also removed the rule from the eslint config file.The rule is described here: https://eslint.org/docs/latest/rules/prefer-template
Note: I've played around with some other linter rules as well, and some seem to point to some specific, non-cosmetic, issues. But before I dive even deeper and then introduce even bigger and hardly understandable changes at once, I thought I'd start with this simple cosmetic rule.