diff --git a/.eslintrc b/.eslintrc index 97450083..b026c49f 100644 --- a/.eslintrc +++ b/.eslintrc @@ -23,11 +23,12 @@ ecmaFeatures: rules: no-global-strict: 0 + no-shadow: 0 strict: 1 no-undef: 1 no-use-before-define: 0 consistent-return: 0 - comma-dangle: "always-multiline" + comma-dangle: [2, "always-multiline"] no-process-exit: 0 quotes: [2, "single"] @@ -35,8 +36,6 @@ rules: no-mixed-spaces-and-tabs: [1, "smart-tabs"] no-spaced-func: 1 space-after-keywords: [1, "always"] - space-before-function-parentheses: {"anonymous": "always", "named": "never"} - space-before-function-paren: {"anonymous": "always", "named": "never"} - space-before-blocks: "always" - space-in-brackets: "always" + space-before-function-paren: [2, {"anonymous": "always", "named": "never"}] + space-before-blocks: [1, "always"] no-underscore-dangle: 0 diff --git a/package.json b/package.json index d5778f00..b875a3d9 100644 --- a/package.json +++ b/package.json @@ -100,10 +100,10 @@ }, "devDependencies": { "babel": "5.5.*", - "babel-eslint": "^2.0.2", + "babel-eslint": "^3.1.15", "coveralls": "^2.11.2", "dateformat": "^1.0.11", - "eslint": "^0.18.0", + "eslint": "^0.23.0", "istanbul": "^0.3.13", "jsesc": "^0.5.0", "jshint": "^2.6.3", diff --git a/src/annotation/annotations/index.js b/src/annotation/annotations/index.js index c145b98c..205d7be6 100644 --- a/src/annotation/annotations/index.js +++ b/src/annotation/annotations/index.js @@ -18,5 +18,5 @@ module.exports = [ require('./since.js'), require('./throw.js'), require('./todo.js'), - require('./type.js') + require('./type.js'), ]; diff --git a/src/annotation/annotations/name.js b/src/annotation/annotations/name.js index f77ab813..63f55227 100644 --- a/src/annotation/annotations/name.js +++ b/src/annotation/annotations/name.js @@ -15,6 +15,6 @@ export default function access() { } }, - multiple: false + multiple: false, }; } diff --git a/src/annotation/annotations/require.js b/src/annotation/annotations/require.js index 725ebf1b..8eb473cc 100644 --- a/src/annotation/annotations/require.js +++ b/src/annotation/annotations/require.js @@ -192,7 +192,7 @@ function searchForMatches(code, regex, isAnnotatedByHandProxy, id = 1) { let matches = []; while ((match = regex.exec(code))) { - if (!isAnnotatedByHandProxy(match[id]) && (id <= 1 || match[id-1] === undefined)) { + if (!isAnnotatedByHandProxy(match[id]) && (id <= 1 || match[id - 1] === undefined)) { matches.push(match[id]); } } diff --git a/src/annotation/annotations/see.js b/src/annotation/annotations/see.js index 40281a98..dd8e068f 100644 --- a/src/annotation/annotations/see.js +++ b/src/annotation/annotations/see.js @@ -9,7 +9,7 @@ export default function see(env) { let obj = { type: match[1] || 'function', - name: match[2] + name: match[2], }; if (obj.name.indexOf('$') === 0) { diff --git a/src/sassdoc.js b/src/sassdoc.js index 6beb5674..0d375220 100644 --- a/src/sassdoc.js +++ b/src/sassdoc.js @@ -258,7 +258,7 @@ async function baseDocumentize(env) { recurse(), exclude(env.exclude || []), converter({ from: 'sass', to: 'scss' }), - filter + filter, ]; let pipeline = () => { diff --git a/test/annotations/envMock.js b/test/annotations/envMock.js index 0c7a1321..16a43593 100644 --- a/test/annotations/envMock.js +++ b/test/annotations/envMock.js @@ -3,5 +3,5 @@ module.exports = { warn: function () {}, log: function () {}, error: function () {}, - } + }, }; diff --git a/test/annotations/parameter.test.js b/test/annotations/parameter.test.js index 060666b8..2d6b20c6 100644 --- a/test/annotations/parameter.test.js +++ b/test/annotations/parameter.test.js @@ -35,8 +35,8 @@ describe('#parameter', function () { warn: function (msg) { assert.equal(msg, '@parameter must at least have a name. Location: FileID:1:2'); done(); - } - } + }, + }, }); assert.deepEqual(param.parse('{type} [default] - description\nmore\nthan\none\nline', { commentRange: { start: 1, end: 2 }}, 'FileID'), undefined); }); diff --git a/test/annotations/property.test.js b/test/annotations/property.test.js index c7f39b62..5cdcb60c 100644 --- a/test/annotations/property.test.js +++ b/test/annotations/property.test.js @@ -8,41 +8,41 @@ describe('#property', function () { it('should parse the prop annotation', function () { assert.deepEqual(prop.parse('base'), { type: 'Map', - name: 'base' + name: 'base', }); assert.deepEqual(prop.parse('{Function} base.default'), { type: 'Function', - name: 'base.default' + name: 'base.default', }); assert.deepEqual(prop.parse('{Function} base.default - description'), { type: 'Function', name: 'base.default', - description: 'description' + description: 'description', }); assert.deepEqual(prop.parse('{Function} base.default [default] - description'), { type: 'Function', name: 'base.default', default: 'default', - description: 'description' + description: 'description', }); assert.deepEqual(prop.parse('{Function} base.default [default] - description [with brackets]'), { type: 'Function', name: 'base.default', default: 'default', - description: 'description [with brackets]' + description: 'description [with brackets]', }); }); - it('should work for multiline description', function(){ + it('should work for multiline description', function () { assert.deepEqual(prop.parse('{Function} base.default [default] - description\nmore\nthan\none\nline'), { type: 'Function', name: 'base.default', default: 'default', - description: 'description\nmore\nthan\none\nline' + description: 'description\nmore\nthan\none\nline', }); }); }); diff --git a/test/annotations/return.test.js b/test/annotations/return.test.js index a4b629b5..55169e70 100644 --- a/test/annotations/return.test.js +++ b/test/annotations/return.test.js @@ -29,8 +29,8 @@ describe('#return', function () { warn: function (msg) { assert.equal(msg, '@return must at least have a type. Location: FileID:1:2'); done(); - } - } + }, + }, }); assert.deepEqual(ret.parse('', { commentRange: { start: 1, end: 2 }}, 'FileID'), undefined); }); diff --git a/test/api/recurse.test.js b/test/api/recurse.test.js index 86721a03..93b5689f 100644 --- a/test/api/recurse.test.js +++ b/test/api/recurse.test.js @@ -31,7 +31,7 @@ describe('#recurse', function () { describe('#recurse-null', function () { var files = []; var nullFile = new File({ - contents: null + contents: null, }); before(function (done) { diff --git a/test/env/environment.test.js b/test/env/environment.test.js index 6d82eb1f..d92589f1 100644 --- a/test/env/environment.test.js +++ b/test/env/environment.test.js @@ -107,8 +107,8 @@ describe('#environment', function () { display: { access: ['public', 'private'], alias: true, - watermark: true - } + watermark: true, + }, }; beforeEach(function () { diff --git a/test/mock.js b/test/mock.js index d23f10a1..00c24672 100644 --- a/test/mock.js +++ b/test/mock.js @@ -32,7 +32,7 @@ Object.defineProperty(SassDocRc.prototype, 'contents', { throw new Error('SassDocRc.contents can only be an Object.'); } this._contents = config; - } + }, }); module.exports.SassDocRc = SassDocRc; @@ -52,7 +52,7 @@ inherits(MockLogger, Logger); Object.defineProperty(MockLogger.prototype, 'output', { get: function () { return this._output; - } + }, }); module.exports.Logger = MockLogger;