Things that I think we can improve upon in code.
sainianubhav opened this issue · 1 comments
sainianubhav commented
- Capitalize required or otherwise names, when
new
is required. e.gGlob
in flow.js should beglob
. - If a name clashes with exported function, e.g.
glob
(required library) will clash withglob()
; we should name imported variable xlib or xLib, e.g. globlib or globLib. - Exports shuold be consistent. There are at least three ways we are exporting functions. Suggestion below.
- Convert promise based code to async/await one.
- Not using
const x = function x(){}
code structure. I am not sure if it helps. If anything, ESlint rules need tweaking to allowconst
toreturn
value. Not every function needs to befunction(){}
.
Consistent Exports
function x() {
}
const y = Math.PI * 22/7;
module.exports = {
x,
y
};
grawk commented
Hi @sainianubhav. Thanks for the suggestions. We appreciate additional