RepoSense
RepoSense copied to clipboard
Use ES6+ way for string interpolation
In the front end pug files, strings are concatenated with variables using the +
operator. This might be messy for lines with a lot of variables concatenated together. Let's use ES6's way for string interpolation: title="`${fileType}: ${user.fileTypeContribution[fileType]} lines, ...`"
https://github.com/reposense/RepoSense/blob/61f1fc4f4f854a176ab1f6672f6759c42712c9c3/frontend/src/index.pug#L267-L269
Update: realise that some parts of the code uses ES6 string interpolation but some don't, let's standardise it.
https://github.com/reposense/RepoSense/blob/61f1fc4f4f854a176ab1f6672f6759c42712c9c3/frontend/src/ramp.pug#L10
Regarding this. I was thinking that we should convert most of our JS code to follow ES6+ way and not just for String interpolation. This could be done slowly through a number of PRs.
Your POV on this?
Your POV on this?
Hmm my view on we should only convert it when it will improve the readability/efficiency.
For anyone who's keen to work on this issue, we no longer have an index.pug
file. The code mentioned can now be found here:
https://github.com/reposense/RepoSense/blob/51cb75848327bf02f7d064602a31f9995fa198bc/frontend/src/components/v-summary-charts.vue#L163-L165
Hi, can I take this issue as a first timer?
@calvintanwj Sure, go ahead. Let us know if you encounter any issues!