Community
Participate
Working Groups
We should add a rule for eslint that will tell you if you 'forgot' to add doc to a function decl / expression. For example: function Foo() { }; would mark 'Foo' and report "Missing documentation for function 'Foo'" also: var obj = { init: function() { } } would mark 'init' and report "Missing documentation for function 'init'"
Pushed to Gerrit: https://git.eclipse.org/r/19875
I almost forgot to mention, this requires a newer version of estraverse, since it makes use of the esraverse.attachComments API. The new version is being asked for: https://dev.eclipse.org/ipzilla/show_bug.cgi?id=7769
(In reply to Michael Rennie from comment #2) > I almost forgot to mention, this requires a newer version of estraverse, > since it makes use of the esraverse.attachComments API. > > The new version is being asked for: > https://dev.eclipse.org/ipzilla/show_bug.cgi?id=7769 I pushed an updated version that has configurable severity levels for each of the checks - default is 'ignore'
(In reply to Michael Rennie from comment #3) > (In reply to Michael Rennie from comment #2) > > I almost forgot to mention, this requires a newer version of estraverse, > > since it makes use of the esraverse.attachComments API. > > > > The new version is being asked for: > > https://dev.eclipse.org/ipzilla/show_bug.cgi?id=7769 > > I pushed an updated version that has configurable severity levels for each > of the checks - default is 'ignore' Created a new change in Gerrit to fix up all the conflicts: https://git.eclipse.org/r/20011
(In reply to Michael Rennie from comment #4) > Created a new change in Gerrit to fix up all the conflicts: > https://git.eclipse.org/r/20011 I ammended the last commit with some tests for the new detection. This lead me to find an edge case. Consider the following snippet: Foo.bar.func = function() {}; I would expect 'func' (or 'Foo.bar.func') to be marked as a problem since it is being assigned to a function. An example of this pattern in practice is the ESRefactor lib code where all exports are defined like: Context.prototype.func1 = function() {} Context.prototype.func2 = function() {} ...etc... return Context;
(In reply to Michael Rennie from comment #5) > This lead me to find an edge case. Consider the following snippet: > > Foo.bar.func = function() {}; > Pushed new change to fix this + more tests to gerrit.
fixed in: http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=7d72bff5e03dbb159bcd783b35da1e93d68073f4