Skip to content

Commit

Permalink
update ESLint; delint
Browse files Browse the repository at this point in the history
  • Loading branch information
hegemonic committed Dec 13, 2014
1 parent 0a77664 commit 416b42f
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
"space-in-parens": 0, // TODO: enable?
"space-infix-ops": 2,
"space-return-throw-case": 2,
"space-unary-word-ops": 2,
"space-unary-ops": [2, "always"],
"spaced-line-comment": [2, "always"],
"wrap-regex": 0,

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"wrench": "~1.3.9"
},
"devDependencies": {
"eslint": "~0.9.1",
"eslint": "~0.10.2",
"gulp": "~3.8.5",
"gulp-eslint": "~0.1.7",
"gulp-json-editor": "~2.0.2",
Expand Down
4 changes: 2 additions & 2 deletions plugins/escapeHtml.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ exports.handlers = {
newDoclet: function(e) {
if (e.doclet.description) {
e.doclet.description = e.doclet.description
.replace(/&/g,'&')
.replace(/</g,'&lt;')
.replace(/&/g, '&amp;')
.replace(/</g, '&lt;')
.replace(/\r\n|\n|\r/g, '<br>');
}
}
Expand Down
4 changes: 2 additions & 2 deletions plugins/partial.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ exports.handlers = {
*/
beforeParse: function(e) {
e.source = e.source.replace(/(@partial \".*\")+/g, function($) {
var pathArg = $.match(/\".*\"/)[0].replace(/"/g,'');
var fullPath = path.join(e.filename , '..', pathArg);
var pathArg = $.match(/\".*\"/)[0].replace(/"/g, '');
var fullPath = path.join(e.filename, '..', pathArg);

var partialData = fs.readFileSync(fullPath, global.env.opts.encoding);

Expand Down
12 changes: 6 additions & 6 deletions templates/haruki/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function graft(parentNode, childNodes, parentLongname, parentName) {
len;

if (element.kind === 'namespace') {
if (! parentNode.namespaces) {
if (!parentNode.namespaces) {
parentNode.namespaces = [];
}

Expand All @@ -33,7 +33,7 @@ function graft(parentNode, childNodes, parentLongname, parentName) {
graft(thisNamespace, childNodes, element.longname, element.name);
}
else if (element.kind === 'mixin') {
if (! parentNode.mixins) {
if (!parentNode.mixins) {
parentNode.mixins = [];
}

Expand All @@ -49,7 +49,7 @@ function graft(parentNode, childNodes, parentLongname, parentName) {
graft(thisMixin, childNodes, element.longname, element.name);
}
else if (element.kind === 'function') {
if (! parentNode.functions) {
if (!parentNode.functions) {
parentNode.functions = [];
}

Expand Down Expand Up @@ -91,7 +91,7 @@ function graft(parentNode, childNodes, parentLongname, parentName) {
}
}
else if (element.kind === 'member') {
if (! parentNode.properties) {
if (!parentNode.properties) {
parentNode.properties = [];
}
parentNode.properties.push({
Expand All @@ -104,7 +104,7 @@ function graft(parentNode, childNodes, parentLongname, parentName) {
}

else if (element.kind === 'event') {
if (! parentNode.events) {
if (!parentNode.events) {
parentNode.events = [];
}

Expand Down Expand Up @@ -146,7 +146,7 @@ function graft(parentNode, childNodes, parentLongname, parentName) {
}
}
else if (element.kind === 'class') {
if (! parentNode.classes) {
if (!parentNode.classes) {
parentNode.classes = [];
}

Expand Down
2 changes: 1 addition & 1 deletion test/specs/documentation/alias.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ describe('aliases', function() {
describe('standard', function() {
var docSet = jasmine.getDocSetFromFile('test/fixtures/alias.js');
var found = docSet.getByLongname('myObject').filter(function($) {
return ! $.undocumented;
return !($.undocumented);
});
var foundMember = docSet.getByLongname('myObject.myProperty');

Expand Down
2 changes: 1 addition & 1 deletion test/specs/documentation/also.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

describe('multiple doclets per symbol', function() {
function undocumented($) {
return ! $.undocumented;
return !($.undocumented);
}

function checkInequality(doclets, property) {
Expand Down
6 changes: 2 additions & 4 deletions test/specs/documentation/lends.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
describe('lends', function() {
describe('when a documented member is inside an object literal associated with a @lends tag', function() {
function removeUndocumented($) {
return !$.undocumented;
return !($.undocumented);
}

describe('standard case', function() {
Expand All @@ -22,9 +22,7 @@ describe('lends', function() {

describe('case containing constructor', function() {
var docSet = jasmine.getDocSetFromFile('test/fixtures/lends2.js');
var person = docSet.getByLongname('Person').filter(function($) {
return ! $.undocumented;
})[0];
var person = docSet.getByLongname('Person').filter(removeUndocumented)[0];
var name = docSet.getByLongname('Person#name');

it('A tag with a @constructs tag is documented as a constructor.', function() {
Expand Down
2 changes: 1 addition & 1 deletion test/specs/documentation/specialnames.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
describe('documenting symbols with special names', function() {
var docSet = jasmine.getDocSetFromFile('test/fixtures/specialnames.js');
var name = docSet.getByLongname('hasOwnProperty').filter(function($) {
return ! $.undocumented;
return !($.undocumented);
});

it('When a symbol is named "hasOwnProperty," the symbol should appear in the docs.', function() {
Expand Down
4 changes: 2 additions & 2 deletions test/specs/tags/borrowstag.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ describe('@borrows tag', function() {
it('When a symbol has a @borrows-as tag, that is added to the symbol\'s "borrowed" property.', function() {
var docSet = jasmine.getDocSetFromFile('test/fixtures/borrowstag.js');
var util = docSet.getByLongname('util').filter(function($) {
return ! $.undocumented;
return !($.undocumented);
})[0];

expect(util.borrowed.length).toBe(1);
Expand All @@ -19,7 +19,7 @@ describe('@borrows tag', function() {
borrow.resolveBorrows(docSet.doclets);

var strRtrim = docSet.getByLongname('str.rtrim').filter(function($) {
return ! $.undocumented;
return !($.undocumented);
})[0];

expect(typeof strRtrim).toBe('object');
Expand Down
4 changes: 2 additions & 2 deletions test/specs/tags/constructstag.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('@constructs tag', function() {
it('When a function symbol has a @constructs tag with no value, in a @lends block with a "Name#" value, the function is documented as a constructor of "Name".', function() {
var docSet = jasmine.getDocSetFromFile('test/fixtures/constructstag4.js');
var person = docSet.getByLongname('Person').filter(function($) {
return ! $.undocumented;
return !($.undocumented);
})[0];

expect(person.kind).toBe('class');
Expand All @@ -45,7 +45,7 @@ describe('@constructs tag', function() {
it('When a object literal property has a @constructs tag with no value, and the object has a @lends, the property is documented as the lent class.', function() {
var docSet = jasmine.getDocSetFromFile('test/fixtures/constructstag5.js');
var duck = docSet.getByLongname('Duck').filter(function($) {
return ! $.undocumented;
return !($.undocumented);
})[0];

expect(duck.longname).toBe('Duck');
Expand Down
4 changes: 2 additions & 2 deletions test/specs/tags/globaltag.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ describe('@global tag', function() {

it('When an inner symbol has a @global tag it is documented as if it were global.', function() {
var found = docSet.getByLongname('foo').filter(function($) {
return ! $.undocumented;
return !($.undocumented);
});

expect(found[0].name).toBe('foo');
Expand All @@ -16,7 +16,7 @@ describe('@global tag', function() {

it('When an nested symbol has a @global tag it is documented as if it were global.', function() {
var found = docSet.getByLongname('Bar').filter(function($) {
return ! $.undocumented;
return !($.undocumented);
});

expect(found[0].name).toBe('Bar');
Expand Down
4 changes: 2 additions & 2 deletions test/specs/tags/moduletag.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('@module tag', function() {
describe('misc', function() {
var docSet = jasmine.getDocSetFromFile('test/fixtures/moduletag2.js');
var mixer = docSet.getByLongname('module:color/mixer').filter(function($) {
return ! $.undocumented;
return !($.undocumented);
})[0];
var blend = docSet.getByLongname('module:color/mixer.blend')[0];
var darken = docSet.getByLongname('module:color/mixer.darken')[0];
Expand Down Expand Up @@ -48,7 +48,7 @@ describe('@module tag', function() {
describe('virtual comments', function() {
var docSet = jasmine.getDocSetFromFile('test/fixtures/moduletag4.js');
var m1 = docSet.getByLongname('module:M1').filter(function($) {
return ! $.undocumented;
return !($.undocumented);
})[0];
var clickProperties = docSet.getByLongname('module:M1~ClickProperties')[0];
var virtFunc = docSet.getByLongname('module:M1.VirtualComment')[0];
Expand Down

0 comments on commit 416b42f

Please sign in to comment.