Instead of separate file you can also use CSR/JSLink here. That way you can consolidate all the function for each of the form in one JavaScript file. You simply need to use JSLink option for those pages(Newform.aspx
, DispForm.aspx
and Editform.aspx
).
Here is the examples for JSLink(CSR):
Client-side rendering (JS Link) code samples
Using JSLink to change the UI of a SharePoint list/view
Great documentation here:
SharePoint 2013 Client Side Rendering: List Views
Introduction to Client-Side Rendering in SharePoint 2013
Using CSR API
Main thing you need to consider here is below snippet:
var options = {
OnPreRender: /* function or array of functions */,
Templates: {
View: /* function or string */,
Body: /* function or string */,
Header: /* function or string */,
Footer: /* function or string */,
Group: /* function or string */,
Item: /* function or string */,
Fields: {
'Field1 Internal Name': {
View: /* function or string */,
EditForm: /* function or string */,
DisplayForm: /* function or string */,
NewForm: /* function or string */
},
'Field2 Internal Name': {
View: /* function or string */,
EditForm: /* function or string */,
DisplayForm: /* function or string */,
NewForm: /* function or string */
},
// .... and so on
}
},
OnPostRender: /* function or array of functions */
};
So as per the code snippet you can specify your function for each views or forms here(centrally managed).
All your advantage you specified will be available and also in disadvantage, you will not face problem in performance because this are the default SharePoint CSR API functions which was overridden and used here.
Also there won't be any problem with conflict issues as all your code is inside one file that you can easily manage.
Only thing you need to do here is open each page one by one and then add JS Link Property with JavaScript file reference. Though this can be disadvantage, I would prefer this API for custom views, forms rendering.
Hope this helps!