diff --git a/.eslintrc b/.eslintrc index 3e57f2274..f7e54960a 100644 --- a/.eslintrc +++ b/.eslintrc @@ -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, diff --git a/package.json b/package.json index 020f3a078..8bb4c9d20 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/plugins/escapeHtml.js b/plugins/escapeHtml.js index d58740527..a900bfa0c 100644 --- a/plugins/escapeHtml.js +++ b/plugins/escapeHtml.js @@ -13,8 +13,8 @@ exports.handlers = { newDoclet: function(e) { if (e.doclet.description) { e.doclet.description = e.doclet.description - .replace(/&/g,'&') - .replace(/'); } } diff --git a/plugins/partial.js b/plugins/partial.js index 9b5171579..feaa1002a 100644 --- a/plugins/partial.js +++ b/plugins/partial.js @@ -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); diff --git a/templates/haruki/publish.js b/templates/haruki/publish.js index 657c85917..21f6847a0 100644 --- a/templates/haruki/publish.js +++ b/templates/haruki/publish.js @@ -17,7 +17,7 @@ function graft(parentNode, childNodes, parentLongname, parentName) { len; if (element.kind === 'namespace') { - if (! parentNode.namespaces) { + if (!parentNode.namespaces) { parentNode.namespaces = []; } @@ -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 = []; } @@ -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 = []; } @@ -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({ @@ -104,7 +104,7 @@ function graft(parentNode, childNodes, parentLongname, parentName) { } else if (element.kind === 'event') { - if (! parentNode.events) { + if (!parentNode.events) { parentNode.events = []; } @@ -146,7 +146,7 @@ function graft(parentNode, childNodes, parentLongname, parentName) { } } else if (element.kind === 'class') { - if (! parentNode.classes) { + if (!parentNode.classes) { parentNode.classes = []; } diff --git a/test/specs/documentation/alias.js b/test/specs/documentation/alias.js index 5d31a1f19..0a88c5312 100644 --- a/test/specs/documentation/alias.js +++ b/test/specs/documentation/alias.js @@ -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'); diff --git a/test/specs/documentation/also.js b/test/specs/documentation/also.js index b620de242..6c15d814f 100644 --- a/test/specs/documentation/also.js +++ b/test/specs/documentation/also.js @@ -2,7 +2,7 @@ describe('multiple doclets per symbol', function() { function undocumented($) { - return ! $.undocumented; + return !($.undocumented); } function checkInequality(doclets, property) { diff --git a/test/specs/documentation/lends.js b/test/specs/documentation/lends.js index 99912a4dc..a5ebcf68a 100644 --- a/test/specs/documentation/lends.js +++ b/test/specs/documentation/lends.js @@ -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() { @@ -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() { diff --git a/test/specs/documentation/specialnames.js b/test/specs/documentation/specialnames.js index 9c45db6f3..edfa24b2d 100644 --- a/test/specs/documentation/specialnames.js +++ b/test/specs/documentation/specialnames.js @@ -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() { diff --git a/test/specs/tags/borrowstag.js b/test/specs/tags/borrowstag.js index 5e4283add..4addc3385 100644 --- a/test/specs/tags/borrowstag.js +++ b/test/specs/tags/borrowstag.js @@ -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); @@ -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'); diff --git a/test/specs/tags/constructstag.js b/test/specs/tags/constructstag.js index 982f2eba1..d5b11f27c 100644 --- a/test/specs/tags/constructstag.js +++ b/test/specs/tags/constructstag.js @@ -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'); @@ -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'); diff --git a/test/specs/tags/globaltag.js b/test/specs/tags/globaltag.js index b6bfe103e..8684f3dab 100644 --- a/test/specs/tags/globaltag.js +++ b/test/specs/tags/globaltag.js @@ -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'); @@ -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'); diff --git a/test/specs/tags/moduletag.js b/test/specs/tags/moduletag.js index 72b611584..aa6539d02 100644 --- a/test/specs/tags/moduletag.js +++ b/test/specs/tags/moduletag.js @@ -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]; @@ -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];