From 05372951d0788d803cba4f1c54730936e2b0d4dc Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Mon, 14 Dec 2015 19:37:07 +0000 Subject: [PATCH] Fix ESLint syntax issues Explicitly disable rules on specific lines as necessary. --- .eslintrc.yml | 2 +- src/gui/html/js/translator.js | 4 ++-- src/tests/gui/html/js/test_plugin.js | 6 +++--- src/tests/gui/html/js/test_translator.js | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.eslintrc.yml b/.eslintrc.yml index 53d7b43b..987ca29e 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -10,6 +10,7 @@ ecmaFeatures: globals: loot: false + Jed: false extends: - "eslint:recommended" @@ -19,4 +20,3 @@ rules: strict: - 2 - global - no-new: 1 diff --git a/src/gui/html/js/translator.js b/src/gui/html/js/translator.js index bfd01567..bb0e0f13 100644 --- a/src/gui/html/js/translator.js +++ b/src/gui/html/js/translator.js @@ -1,6 +1,6 @@ 'use strict'; -(function (root, factory) { +(function exportModule(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define(['bower_components/Jed/jed', 'bower_components/jed-gettext-parser/jedGettextParser'], factory); @@ -53,7 +53,7 @@ } return translationDataPromise.catch((error) => { - console.log('Error loading translation data: ' + error.message); + console.log('Error loading translation data: ' + error.message); // eslint-disable-line no-console return defaultTranslationData; }).then((result) => { this.jed = new Jed({ diff --git a/src/tests/gui/html/js/test_plugin.js b/src/tests/gui/html/js/test_plugin.js index 78bb99a7..4bf6c49c 100644 --- a/src/tests/gui/html/js/test_plugin.js +++ b/src/tests/gui/html/js/test_plugin.js @@ -3,15 +3,15 @@ describe('Plugin', () => { describe('#Plugin()', () => { it('should throw if nothing is passed', () => { - (() => { new loot.Plugin(); }).should.throw(); + (() => { new loot.Plugin(); }).should.throw(); // eslint-disable-line no-new }); it('should throw if an object with no name key is passed', () => { - (() => { new loot.Plugin({}); }).should.throw(); + (() => { new loot.Plugin({}); }).should.throw(); // eslint-disable-line no-new }); it('should not throw if some members are undefined', () => { - (() => { new loot.Plugin({ name: 'test' }); }).should.not.throw(); + (() => { new loot.Plugin({ name: 'test' }); }).should.not.throw(); // eslint-disable-line no-new }); }); diff --git a/src/tests/gui/html/js/test_translator.js b/src/tests/gui/html/js/test_translator.js index 16cdae02..c48737e6 100644 --- a/src/tests/gui/html/js/test_translator.js +++ b/src/tests/gui/html/js/test_translator.js @@ -17,7 +17,7 @@ describe('Translator', () => { it('should return a Promise', () => { const l10n = new loot.Translator(); - l10n.load().should.be.a.Promise(); + l10n.load().should.be.a.Promise(); // eslint-disable-line new-cap }); it('should be fulfilled for a locale of "en"', () => {