How are you managing your java script/Js files?

Johan kleine Bjällskog
6 min readMar 8, 2019

And are you happy about it? I hope not and that's why you are reading this article. I have built many pages and worked with front end for a long time now. I have tried different approaches and I believe that in the last project that I did, or that I´am currently developing, I have found some good rules and ways to work with scripts. I wish to share it and maybe get some discussion/feedback on it.

What I think is most important is readability, maintenance and working in team. The last one might need some explaining, but its mainly that I think its important for everyone in the team junior/senior to understand and find what they are looking for easy.

So first lets just see what we are using.

Gulp - Use gulp or grunt or something else, the important thing is that we want to concatenate and minify the JS, and I use gulp to do that. We only want one server-call for all our JS.

Eslint - I think it helps to have some rules when you code, especially when there are many front-enders in the same project, but also for handovers, when someone else should continue developing the project, and can do so because of the Eslint rules will show him/her the way. But Im also a firm believer that you should not use all the rules, only the one that suites you and the project, so be picky and choose the one…

--

--

Johan kleine Bjällskog

Lead front-end developer, movie lover and a junkie of series.