More often than I care to admit, I've written code like the following:
define(["some/dep"], function (Dep) {
var MyThing = {
// 500+ lines of code
};
// oops, forgot to return MyThing
});
We could create a rule which uses code path analysis to ensure that all code paths either return something (AMD) or assign to module or exports (CommonJS).
More often than I care to admit, I've written code like the following:
We could create a rule which uses code path analysis to ensure that all code paths either return something (AMD) or assign to module or exports (CommonJS).