diff --git a/.jshintignore b/.eslintignore similarity index 100% rename from .jshintignore rename to .eslintignore diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 000000000..c89b03ded --- /dev/null +++ b/.eslintrc @@ -0,0 +1,108 @@ +{ + "parserOptions": { + "ecmaVersion": 5, + }, + + "env": { + "browser": true, + "es6": true, + "worker": true, + "amd": true, + }, + + globals: { + "PDFJSDev": false, + "require": false, + "exports": false, + }, + + "rules": { + // Possible errors + "no-cond-assign": ["error", "except-parens"], + "no-constant-condition": ["error", { "checkLoops": false, }], + "no-dupe-args": "error", + "no-dupe-keys": "error", + "no-duplicate-case": "error", + "no-empty": ["error", { "allowEmptyCatch": true, }], + "no-ex-assign": "error", + "no-extra-boolean-cast": "error", + "no-extra-semi": "error", + "no-func-assign": "error", + "no-inner-declarations": ["error", "functions"], + "no-invalid-regexp": "error", + "no-irregular-whitespace": "error", + "no-obj-calls": "error", + "no-regex-spaces": "error", + "no-sparse-arrays": "error", + "no-unexpected-multiline": "error", + "no-unreachable": "error", + "no-unsafe-negation": "error", + "use-isnan": "error", + "valid-typeof": ["error", { "requireStringLiterals": true, }], + + // Best Practices + "accessor-pairs": ["error", { "setWithoutGet": true, }], + "curly": ["error", "all"], + "eqeqeq": ["error", "always"], + "no-caller": "error", + "no-eval": "error", + "no-extend-native": "error", + "no-extra-bind": "error", + "no-extra-label": "error", + "no-fallthrough": "error", + "no-global-assign": "error", + "no-implied-eval": "error", + "no-multi-spaces": "error", + "no-multi-str": "error", + "no-new-func": "error", + "no-new-wrappers": "error", + "no-new": "error", + "no-octal-escape": "error", + "no-redeclare": "error", + "no-self-assign": "error", + "no-unused-expressions": "error", + "no-unused-labels": "error", + "no-useless-concat": "error", + "wrap-iife": ["error", "any"], + "yoda": ["error", "never", { "onlyEquality": true, }], + + // Strict Mode + "strict": ["error", "global"], + + // Variables + "no-catch-shadow": "error", + "no-label-var": "error", + "no-shadow-restricted-names": "error", + "no-undef-init": "error", + "no-undef": ["error", { "typeof": true, }], + + // Stylistic Issues + "array-bracket-spacing": ["error", "never"], + "block-spacing": ["error", "always"], + "brace-style": ["error", "1tbs", { "allowSingleLine": true, }], + "comma-spacing": ["error", { "before": false, "after": true, }], + "comma-style": ["error", "last"], + "eol-last": "error", + "func-call-spacing": ["error", "never"], + "key-spacing": ["error", { "beforeColon": false, "afterColon": true, "mode": "strict", }], + "keyword-spacing": ["error", { "before": true, "after": true, }], + "linebreak-style": ["error", "unix"], + "max-len": ["error", 80], + "new-cap": ["error", { "newIsCap": true, "capIsNew": false, }], + "new-parens": "error", + "no-array-constructor": "error", + "no-multiple-empty-lines": ["error", { "max": 2, "maxEOF": 0, "maxBOF": 1, }], + "no-tabs": "error", + "no-trailing-spaces": ["error", { "skipBlankLines": false, }], + "no-whitespace-before-property": "error", + "operator-linebreak": ["error", "after", { "overrides": { ":": "ignore", } }], + "quotes": ["error", "single"], + "semi-spacing": ["error", { "before": false, "after": true, }], + "semi": ["error", "always"], + "space-before-blocks": ["error", "always"], + "space-before-function-paren": ["error", { "anonymous": "ignore", "named": "never", }], + "space-in-parens": ["error", "never"], + "space-infix-ops": ["error", { "int32Hint": false }], + "space-unary-ops": ["error", { "words": true, "nonwords": false, "overrides": { "void": false, }, }], + }, +} diff --git a/.jshintrc b/.jshintrc deleted file mode 100644 index 34b5e6998..000000000 --- a/.jshintrc +++ /dev/null @@ -1,33 +0,0 @@ -{ - // Environments - "browser": true, - "devel": true, - "worker": true, - "predef": [ - "Promise", - "PDFJSDev", - "require", - "define", - "exports" - ], - - // Enforcing - "maxlen": 80, - "quotmark": "single", - "trailing": true, - "curly": true, - "undef": true, - "noarg": true, - "nonbsp": true, - "eqeqeq": true, - - // Relaxing - "boss": true, - "funcscope": true, - "globalstrict": true, - "loopfunc": true, - "maxerr": 1000, - "nonstandard": true, - "sub": true, - "validthis": true -} diff --git a/examples/mobile-viewer/viewer.js b/examples/mobile-viewer/viewer.js index 4e6116fa6..2c6cbb21f 100644 --- a/examples/mobile-viewer/viewer.js +++ b/examples/mobile-viewer/viewer.js @@ -12,8 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -/* globals PDFJS, Promise */ +/* globals PDFJS */ 'use strict'; diff --git a/extensions/chromium/options/migration.js b/extensions/chromium/options/migration.js index 6d9f4c514..32577fbda 100644 --- a/extensions/chromium/options/migration.js +++ b/extensions/chromium/options/migration.js @@ -13,6 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ +/* eslint strict: ["error", "function"] */ /* globals chrome */ (function() { diff --git a/extensions/chromium/options/options.js b/extensions/chromium/options/options.js index 46b02bb8a..62b6ded9c 100644 --- a/extensions/chromium/options/options.js +++ b/extensions/chromium/options/options.js @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -/* globals chrome, Promise */ +/* globals chrome */ 'use strict'; var storageAreaName = chrome.storage.sync ? 'sync' : 'local'; diff --git a/extensions/chromium/pdfHandler-vcros.js b/extensions/chromium/pdfHandler-vcros.js index ca4855bd3..4ed546302 100644 --- a/extensions/chromium/pdfHandler-vcros.js +++ b/extensions/chromium/pdfHandler-vcros.js @@ -13,6 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ +/* eslint strict: ["error", "function"] */ /* globals chrome, getViewerURL */ (function() { diff --git a/extensions/chromium/telemetry.js b/extensions/chromium/telemetry.js index b23cac530..fa03b912b 100644 --- a/extensions/chromium/telemetry.js +++ b/extensions/chromium/telemetry.js @@ -13,6 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ +/* eslint strict: ["error", "function"] */ /* globals chrome, crypto, Headers, Request */ (function() { diff --git a/extensions/firefox/.eslintrc b/extensions/firefox/.eslintrc new file mode 100644 index 000000000..71258ac58 --- /dev/null +++ b/extensions/firefox/.eslintrc @@ -0,0 +1,9 @@ +{ + "extends": [ + ../../.eslintrc + ], + + "parserOptions": { + "ecmaVersion": 6 + }, +} diff --git a/extensions/firefox/bootstrap.js b/extensions/firefox/bootstrap.js index 0ff82985f..fcb1d0ce1 100644 --- a/extensions/firefox/bootstrap.js +++ b/extensions/firefox/bootstrap.js @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* jshint esnext:true */ /* globals Components, Services, dump, XPCOMUtils, PdfStreamConverter, APP_SHUTDOWN, PdfjsChromeUtils, PdfjsContentUtils */ diff --git a/extensions/firefox/chrome/content.js b/extensions/firefox/chrome/content.js index 143ed30d7..b9afd9826 100644 --- a/extensions/firefox/chrome/content.js +++ b/extensions/firefox/chrome/content.js @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* jshint esnext:true */ /* globals Components, Services, XPCOMUtils, PdfjsContentUtils, PdfjsContentUtils, PdfStreamConverter, addMessageListener */ diff --git a/extensions/firefox/content/PdfJs-stub.jsm b/extensions/firefox/content/PdfJs-stub.jsm index e89ad975d..84d13258a 100644 --- a/extensions/firefox/content/PdfJs-stub.jsm +++ b/extensions/firefox/content/PdfJs-stub.jsm @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* jshint esnext:true, maxlen:100 */ +/* eslint max-len: ["error", 100] */ 'use strict'; diff --git a/extensions/firefox/content/PdfJs.jsm b/extensions/firefox/content/PdfJs.jsm index 454b1f8b0..b86cbbcda 100644 --- a/extensions/firefox/content/PdfJs.jsm +++ b/extensions/firefox/content/PdfJs.jsm @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* jshint esnext:true */ /* globals Components, Services, XPCOMUtils, PdfjsChromeUtils, PdfjsContentUtils, PdfStreamConverter */ diff --git a/extensions/firefox/content/PdfJsTelemetry-addon.jsm b/extensions/firefox/content/PdfJsTelemetry-addon.jsm index a31687ddd..06097eb15 100644 --- a/extensions/firefox/content/PdfJsTelemetry-addon.jsm +++ b/extensions/firefox/content/PdfJsTelemetry-addon.jsm @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* jshint esnext:true, maxlen:120 */ +/* eslint max-len: ["error", 120] */ /* globals Components, Services */ 'use strict'; diff --git a/extensions/firefox/content/PdfJsTelemetry.jsm b/extensions/firefox/content/PdfJsTelemetry.jsm index 275da9d87..0d34cd50e 100644 --- a/extensions/firefox/content/PdfJsTelemetry.jsm +++ b/extensions/firefox/content/PdfJsTelemetry.jsm @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* jshint esnext:true, maxlen: 100 */ +/* eslint max-len: ["error", 100] */ /* globals Components, Services */ 'use strict'; diff --git a/extensions/firefox/content/PdfStreamConverter.jsm b/extensions/firefox/content/PdfStreamConverter.jsm index a89cc5e77..298387192 100644 --- a/extensions/firefox/content/PdfStreamConverter.jsm +++ b/extensions/firefox/content/PdfStreamConverter.jsm @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* jshint esnext:true */ /* globals Components, Services, XPCOMUtils, NetUtil, PrivateBrowsingUtils, dump, NetworkManager, PdfJsTelemetry, PdfjsContentUtils */ diff --git a/extensions/firefox/content/PdfjsChromeUtils.jsm b/extensions/firefox/content/PdfjsChromeUtils.jsm index 2ce624619..16bb0d9ca 100644 --- a/extensions/firefox/content/PdfjsChromeUtils.jsm +++ b/extensions/firefox/content/PdfjsChromeUtils.jsm @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* jshint esnext:true */ /* globals Components, Services, XPCOMUtils */ 'use strict'; diff --git a/extensions/firefox/content/PdfjsContentUtils.jsm b/extensions/firefox/content/PdfjsContentUtils.jsm index 92e7ade27..aec9f8c76 100644 --- a/extensions/firefox/content/PdfjsContentUtils.jsm +++ b/extensions/firefox/content/PdfjsContentUtils.jsm @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* jshint esnext:true */ /* globals Components, Services, XPCOMUtils */ 'use strict'; diff --git a/extensions/firefox/content/pdfjschildbootstrap.js b/extensions/firefox/content/pdfjschildbootstrap.js index 2cab05f44..c44cd3bd4 100644 --- a/extensions/firefox/content/pdfjschildbootstrap.js +++ b/extensions/firefox/content/pdfjschildbootstrap.js @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* jshint esnext:true */ /* globals Components, PdfjsContentUtils, PdfJs, Services */ 'use strict'; diff --git a/extensions/firefox/tools/l10n.js b/extensions/firefox/tools/l10n.js index 04346ee1d..e45cf200a 100644 --- a/extensions/firefox/tools/l10n.js +++ b/extensions/firefox/tools/l10n.js @@ -1,4 +1,3 @@ - 'use strict'; // Small subset of the webL10n API by Fabien Cazenave for pdf.js extension. diff --git a/external/.eslintrc b/external/.eslintrc new file mode 100644 index 000000000..3692bbae9 --- /dev/null +++ b/external/.eslintrc @@ -0,0 +1,10 @@ +{ + "extends": [ + ../.eslintrc + ], + + "env": { + "node": true, + "shelljs": true, + }, +} diff --git a/external/builder/builder.js b/external/builder/builder.js index 31f07fa9e..8ee87e0b3 100644 --- a/external/builder/builder.js +++ b/external/builder/builder.js @@ -1,6 +1,3 @@ -/* jshint node:true */ -/* globals cp, ls, test */ - 'use strict'; var fs = require('fs'), @@ -107,10 +104,8 @@ function preprocess(inFilename, outFilename, defines) { var line; var state = STATE_NONE; var stack = []; - var control = - /* jshint -W101 */ + var control = // eslint-disable-next-line max-len /^(?:\/\/|)?$)?/; - /* jshint +W101 */ var lineNumber = 0; var loc = function() { return fs.realpathSync(inFilename) + ':' + lineNumber; diff --git a/external/builder/fixtures/.eslintrc b/external/builder/fixtures/.eslintrc new file mode 100644 index 000000000..94eb4f06e --- /dev/null +++ b/external/builder/fixtures/.eslintrc @@ -0,0 +1,11 @@ +{ + "extends": [ + ../../.eslintrc + ], + + "rules": { + "no-empty": "off", + "keyword-spacing": "off", + "space-infix-ops": "off", + }, +} diff --git a/external/builder/preprocessor2.js b/external/builder/preprocessor2.js index 9967e1a51..ed05d2f55 100644 --- a/external/builder/preprocessor2.js +++ b/external/builder/preprocessor2.js @@ -1,5 +1,3 @@ -/* jshint node:true */ - 'use strict'; var esprima = require('esprima'); @@ -197,8 +195,12 @@ function fixComments(ctx, node) { } // Fixes double comments in the escodegen output. delete node.trailingComments; - // Removes jshint and other service comments. + // Removes ESLint and other service comments. if (node.leadingComments) { + var CopyrightRegExp = /\bcopyright\b/i; + var BlockCommentRegExp = /^\s*(globals|eslint|falls through|umdutils)\b/; + var LineCommentRegExp = /^\s*eslint\b/; + var i = 0; while (i < node.leadingComments.length) { var type = node.leadingComments[i].type; @@ -206,12 +208,12 @@ function fixComments(ctx, node) { if (ctx.saveComments === 'copyright') { // Remove all comments, except Copyright notices and License headers. - if (!(type === 'Block' && /\bcopyright\b/i.test(value))) { + if (!(type === 'Block' && CopyrightRegExp.test(value))) { node.leadingComments.splice(i, 1); continue; } - } else if (type === 'Block' && - /^\s*(globals|jshint|falls through|umdutils)\b/.test(value)) { + } else if ((type === 'Block' && BlockCommentRegExp.test(value)) || + (type === 'Line' && LineCommentRegExp.test(value))) { node.leadingComments.splice(i, 1); continue; } diff --git a/external/builder/test.js b/external/builder/test.js index 8d4007fbe..53c0cd8b6 100644 --- a/external/builder/test.js +++ b/external/builder/test.js @@ -1,5 +1,3 @@ -/* jshint node:true */ -/* globals cat, cd, echo, ls */ 'use strict'; require('shelljs/make'); diff --git a/external/builder/test2.js b/external/builder/test2.js index f29b434e5..aac26bd50 100644 --- a/external/builder/test2.js +++ b/external/builder/test2.js @@ -1,5 +1,3 @@ -/* jshint node:true */ -/* globals cat, cd, echo, ls */ 'use strict'; require('shelljs/make'); diff --git a/external/crlfchecker/crlfchecker.js b/external/crlfchecker/crlfchecker.js index f331daebe..c136af3bd 100644 --- a/external/crlfchecker/crlfchecker.js +++ b/external/crlfchecker/crlfchecker.js @@ -1,6 +1,3 @@ -/* jshint node:true */ -/* globals cat, echo, exit, ls */ - 'use strict'; function checkIfCrlfIsPresent(files) { diff --git a/external/crlfchecker/normtext.js b/external/crlfchecker/normtext.js index ef8a919c1..bbcd6e89a 100644 --- a/external/crlfchecker/normtext.js +++ b/external/crlfchecker/normtext.js @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* jshint node:true */ 'use strict'; diff --git a/external/importL10n/locales.js b/external/importL10n/locales.js index 1336545be..1290101cd 100644 --- a/external/importL10n/locales.js +++ b/external/importL10n/locales.js @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* jshint node:true */ 'use strict'; diff --git a/gulpfile.js b/gulpfile.js index 430ba60dd..1cdc1c126 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* jshint node:true */ +/* eslint-env node */ /* globals target */ 'use strict'; @@ -529,12 +529,12 @@ gulp.task('lint', function (done) { console.log(); console.log('### Linting JS files'); - // Lint the Firefox specific *.jsm files. - var options = ['node_modules/jshint/bin/jshint', '--extra-ext', '.jsm', '.']; - var jshintProcess = spawn('node', options, {stdio: 'inherit'}); - jshintProcess.on('close', function (code) { + // Ensure that we lint the Firefox specific *.jsm files too. + var options = ['node_modules/eslint/bin/eslint', '--ext', '.js,.jsm', '.']; + var esLintProcess = spawn('node', options, {stdio: 'inherit'}); + esLintProcess.on('close', function (code) { if (code !== 0) { - done(new Error('jshint failed.')); + done(new Error('ESLint failed.')); return; } diff --git a/make.js b/make.js index 80cf970d9..2dc4b6660 100644 --- a/make.js +++ b/make.js @@ -12,9 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* jshint node:true */ -/* globals cat, cd, cp, echo, env, exec, exit, find, ls, mkdir, mv, process, rm, - sed, target, test */ +/* eslint-env node, shelljs */ 'use strict'; diff --git a/package.json b/package.json index 2bf86aaf3..35042a058 100644 --- a/package.json +++ b/package.json @@ -3,13 +3,13 @@ "version": "0.8.0", "devDependencies": { "escodegen": "^1.8.0", + "eslint": "^3.11.1", "esprima": "^2.7.2", "gulp": "^3.9.1", "gulp-util": "^3.0.7", "gulp-zip": "^3.2.0", "jasmine-core": "^2.4.1", "jsdoc": "^3.3.0-alpha9", - "jshint": "~2.8.0", "mkdirp": "^0.5.1", "node-ensure": "^0.0.0", "requirejs": "^2.1.22", diff --git a/src/core/fonts.js b/src/core/fonts.js index 6364ba857..cbd9c1f35 100644 --- a/src/core/fonts.js +++ b/src/core/fonts.js @@ -983,7 +983,7 @@ var Font = (function FontClosure() { // Split the sorted codes into ranges. var ranges = []; var length = codes.length; - for (var n = 0; n < length; ) { + for (var n = 0; n < length; ) { // eslint-disable-line space-in-parens var start = codes[n].fontCharCode; var codeIndices = [codes[n].glyphId]; ++n; diff --git a/src/core/function.js b/src/core/function.js index 6d05d4431..24d281986 100644 --- a/src/core/function.js +++ b/src/core/function.js @@ -423,7 +423,7 @@ var PDFFunction = (function PDFFunctionClosure() { // Compiled function consists of simple expressions such as addition, // subtraction, Math.max, and also contains 'var' and 'return' // statements. See the generation in the PostScriptCompiler below. - /*jshint -W054 */ + // eslint-disable-next-line no-new-func return new Function('src', 'srcOffset', 'dest', 'destOffset', compiled); } diff --git a/src/core/jpg.js b/src/core/jpg.js index d5a9bf836..cae72d490 100644 --- a/src/core/jpg.js +++ b/src/core/jpg.js @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +/* eslint-disable no-multi-spaces */ 'use strict'; diff --git a/src/core/murmurhash3.js b/src/core/murmurhash3.js index c45bcc03e..ccb4c9c1e 100644 --- a/src/core/murmurhash3.js +++ b/src/core/murmurhash3.js @@ -1,4 +1,3 @@ - /* Copyright 2014 Opera Software ASA * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -48,6 +47,7 @@ var MurmurHash3_64 = (function MurmurHash3_64Closure(seed) { !PDFJSDev.test('FIREFOX || MOZCENTRAL || CHROME')) { // old webkits have issues with non-aligned arrays try { + // eslint-disable-next-line no-new new Uint32Array(new Uint8Array(5).buffer, 0, 1); } catch (e) { alwaysUseUint32ArrayView = true; diff --git a/src/core/parser.js b/src/core/parser.js index 378d30855..88ad7038f 100644 --- a/src/core/parser.js +++ b/src/core/parser.js @@ -248,29 +248,29 @@ var Parser = (function ParserClosure() { case 0xC1: // SOF1 case 0xC2: // SOF2 case 0xC3: // SOF3 - + /* falls through */ case 0xC5: // SOF5 case 0xC6: // SOF6 case 0xC7: // SOF7 - + /* falls through */ case 0xC9: // SOF9 case 0xCA: // SOF10 case 0xCB: // SOF11 - + /* falls through */ case 0xCD: // SOF13 case 0xCE: // SOF14 case 0xCF: // SOF15 - + /* falls through */ case 0xC4: // DHT case 0xCC: // DAC - + /* falls through */ case 0xDA: // SOS case 0xDB: // DQT case 0xDC: // DNL case 0xDD: // DRI case 0xDE: // DHP case 0xDF: // EXP - + /* falls through */ case 0xE0: // APP0 case 0xE1: // APP1 case 0xE2: // APP2 @@ -287,7 +287,7 @@ var Parser = (function ParserClosure() { case 0xED: // APP13 case 0xEE: // APP14 case 0xEF: // APP15 - + /* falls through */ case 0xFE: // COM // The marker should be followed by the length of the segment. markerLength = stream.getUint16(); diff --git a/src/core/pattern.js b/src/core/pattern.js index b69d9dd4f..eaef68446 100644 --- a/src/core/pattern.js +++ b/src/core/pattern.js @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +/* eslint-disable no-multi-spaces */ 'use strict'; diff --git a/src/core/worker.js b/src/core/worker.js index 5b9722caf..1aa13ecf4 100644 --- a/src/core/worker.js +++ b/src/core/worker.js @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* globals NetworkManager, module */ +/* globals module */ 'use strict'; @@ -83,14 +83,13 @@ var WorkerTask = (function WorkerTaskClosure() { })(); if (typeof PDFJSDev === 'undefined' || !PDFJSDev.test('PRODUCTION')) { -/*jshint -W082 */ /** * Interface that represents PDF data transport. If possible, it allows * progressively load entire or fragment of the PDF binary data. * * @interface - * */ -function IPDFStream() {} + */ +function IPDFStream() {} // eslint-disable-line no-inner-declarations IPDFStream.prototype = { /** * Gets a reader for the entire PDF data. @@ -118,7 +117,7 @@ IPDFStream.prototype = { * * @interface */ -function IPDFStreamReader() {} +function IPDFStreamReader() {} // eslint-disable-line no-inner-declarations IPDFStreamReader.prototype = { /** * Gets a promise that is resolved when the headers and other metadata of @@ -179,7 +178,7 @@ IPDFStreamReader.prototype = { * * @interface */ -function IPDFStreamRangeReader() {} +function IPDFStreamRangeReader() {} // eslint-disable-line no-inner-declarations IPDFStreamRangeReader.prototype = { /** * Gets ability of the stream to progressively load binary data. diff --git a/src/display/api.js b/src/display/api.js index cb4ad0383..c60eae177 100644 --- a/src/display/api.js +++ b/src/display/api.js @@ -13,7 +13,7 @@ * limitations under the License. */ /* globals pdfjsFilePath, pdfjsVersion, pdfjsBuild, requirejs, pdfjsLibs, - WeakMap */ + __webpack_require__ */ 'use strict'; diff --git a/src/display/canvas.js b/src/display/canvas.js index 47d07a901..c3c759468 100644 --- a/src/display/canvas.js +++ b/src/display/canvas.js @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* globals ImageData */ 'use strict'; diff --git a/src/display/font_loader.js b/src/display/font_loader.js index f15d13734..7ba16c9d1 100644 --- a/src/display/font_loader.js +++ b/src/display/font_loader.js @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* globals FontFace */ 'use strict'; @@ -426,7 +425,7 @@ var FontFaceObject = (function FontFaceObjectClosure() { js += 'c.' + current.cmd + '(' + args + ');\n'; } - /* jshint -W054 */ + // eslint-disable-next-line no-new-func this.compiledGlyphs[character] = new Function('c', 'size', js); } else { // But fall back on using Function.prototype.apply() if we're diff --git a/src/display/metadata.js b/src/display/metadata.js index d79128ffb..cfa6d3905 100644 --- a/src/display/metadata.js +++ b/src/display/metadata.js @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* globals Document */ 'use strict'; diff --git a/src/display/svg.js b/src/display/svg.js index 9530095c7..ece7d9074 100644 --- a/src/display/svg.js +++ b/src/display/svg.js @@ -460,7 +460,7 @@ var SVGGraphics = (function SVGGraphicsClosure() { convertOpList: function SVGGraphics_convertOpList(operatorList) { var argsArray = operatorList.argsArray; var fnArray = operatorList.fnArray; - var fnArrayLen = fnArray.length; + var fnArrayLen = fnArray.length; var REVOPS = []; var opList = []; diff --git a/src/display/text_layer.js b/src/display/text_layer.js index d14a5f6be..aaf597c74 100644 --- a/src/display/text_layer.js +++ b/src/display/text_layer.js @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* globals WeakMap */ 'use strict'; diff --git a/src/display/webgl.js b/src/display/webgl.js index 4c02fd7ca..dc2b95761 100644 --- a/src/display/webgl.js +++ b/src/display/webgl.js @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* jshint -W043 */ +/* eslint-disable no-multi-str */ 'use strict'; diff --git a/src/doc_helper.js b/src/doc_helper.js index 86632b455..d6707e3a3 100644 --- a/src/doc_helper.js +++ b/src/doc_helper.js @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +/* eslint-disable strict */ /* NOTE: This file is created as a helper to assist with JSDoc html files. diff --git a/src/pdf.js b/src/pdf.js index 0322f8b2a..e70d6f0de 100644 --- a/src/pdf.js +++ b/src/pdf.js @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* jshint globalstrict: false */ +/* eslint strict: ["error", "function"] */ /* umdutils ignore */ (function (root, factory) { diff --git a/src/pdf.worker.entry.js b/src/pdf.worker.entry.js index 8ad5d5dff..1950ad7de 100644 --- a/src/pdf.worker.entry.js +++ b/src/pdf.worker.entry.js @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +/* eslint-disable strict */ (typeof window !== 'undefined' ? window : {}).pdfjsDistBuildPdfWorker = require('./pdf.worker.js'); - diff --git a/src/shared/fonts_utils.js b/src/shared/fonts_utils.js index d282983df..555b18e19 100644 --- a/src/shared/fonts_utils.js +++ b/src/shared/fonts_utils.js @@ -73,7 +73,7 @@ function readCharstringEncoding(aString) { var charstringTokens = []; var count = aString.length; - for (var i = 0; i < count; ) { + for (var i = 0; i < count; ) { // eslint-disable-line space-in-parens var value = aString[i++] | 0; var token = null; diff --git a/src/shared/util.js b/src/shared/util.js index 4e3e50197..6aef87621 100644 --- a/src/shared/util.js +++ b/src/shared/util.js @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* globals URL, global */ +/* globals global */ 'use strict'; @@ -620,8 +620,7 @@ function isLittleEndian() { // Checks if it's possible to eval JS expressions. function isEvalSupported() { try { - /* jshint evil: true */ - new Function(''); + new Function(''); // eslint-disable-line no-new, no-new-func return true; } catch (e) { return false; @@ -1756,6 +1755,8 @@ if (typeof PDFJSDev === 'undefined' || !PDFJSDev.test('MOZCENTRAL')) { /* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ (function checkURLConstructor(scope) { + /* eslint-disable yoda */ + // feature detect for URL constructor var hasWorkingUrl = false; try { @@ -2392,6 +2393,8 @@ if (typeof PDFJSDev === 'undefined' || !PDFJSDev.test('MOZCENTRAL')) { } scope.URL = JURL; + + /* eslint-enable yoda */ })(globalScope); } diff --git a/test/.eslintrc b/test/.eslintrc new file mode 100644 index 000000000..692abd312 --- /dev/null +++ b/test/.eslintrc @@ -0,0 +1,11 @@ +{ + "extends": [ + ../.eslintrc + ], + + "env": { + "node": true, + "shelljs": true, + "jasmine": true, + }, +} diff --git a/test/downloadutils.js b/test/downloadutils.js index d2f4333b3..10e8f4e71 100644 --- a/test/downloadutils.js +++ b/test/downloadutils.js @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/*jslint node: true */ 'use strict'; diff --git a/test/font/jasmine-boot.js b/test/font/jasmine-boot.js index 0260e8af0..1f4e24a66 100644 --- a/test/font/jasmine-boot.js +++ b/test/font/jasmine-boot.js @@ -34,7 +34,7 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*globals jasmineRequire, jasmine, TestReporter */ +/* globals jasmineRequire, TestReporter */ // Modified jasmine's boot.js file to load PDF.js libraries async. diff --git a/test/font/ttxdriver.js b/test/font/ttxdriver.js index 9380666ec..7284436c1 100644 --- a/test/font/ttxdriver.js +++ b/test/font/ttxdriver.js @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/*jslint node: true */ 'use strict'; diff --git a/test/stats/statcmp.js b/test/stats/statcmp.js index 0b15dc5ab..73ed7724d 100644 --- a/test/stats/statcmp.js +++ b/test/stats/statcmp.js @@ -1,5 +1,3 @@ -/*jslint node: true */ - 'use strict'; var fs = require('fs'); diff --git a/test/test.js b/test/test.js index fa588fd2b..2dcdeeec1 100644 --- a/test/test.js +++ b/test/test.js @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/*jslint node: true */ 'use strict'; diff --git a/test/testutils.js b/test/testutils.js index 364099098..ca000f050 100644 --- a/test/testutils.js +++ b/test/testutils.js @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/*jslint node: true */ 'use strict'; diff --git a/test/unit/annotation_layer_spec.js b/test/unit/annotation_layer_spec.js index 75fade444..2e224d1b3 100644 --- a/test/unit/annotation_layer_spec.js +++ b/test/unit/annotation_layer_spec.js @@ -1,8 +1,7 @@ -/* globals expect, it, describe, Dict, Name, Annotation, AnnotationBorderStyle, - AnnotationBorderStyleType, AnnotationType, AnnotationFlag, PDFJS, - beforeEach, afterEach, stringToBytes, AnnotationFactory, Ref, isRef, - beforeAll, afterAll, AnnotationFieldFlag, stringToUTF8String, - StringStream, Lexer, Parser */ +/* globals isRef, AnnotationFactory, Dict, Name, Ref, AnnotationType, + AnnotationFlag, Annotation, AnnotationBorderStyle, + AnnotationBorderStyleType, StringStream, Lexer, Parser, + stringToUTF8String, AnnotationFieldFlag, PDFJS, stringToBytes */ 'use strict'; diff --git a/test/unit/api_spec.js b/test/unit/api_spec.js index 06484106b..2320c71fa 100644 --- a/test/unit/api_spec.js +++ b/test/unit/api_spec.js @@ -1,7 +1,6 @@ -/* globals PDFJS, expect, it, describe, Promise, beforeAll, - InvalidPDFException, MissingPDFException, StreamType, FontType, - PDFDocumentProxy, PasswordException, PasswordResponses, afterAll, - PDFPageProxy, createPromiseCapability, afterEach */ +/* globals PDFJS, createPromiseCapability, PDFDocumentProxy, + InvalidPDFException, MissingPDFException, PasswordResponses, + PasswordException, PDFPageProxy, StreamType, FontType */ 'use strict'; diff --git a/test/unit/cff_parser_spec.js b/test/unit/cff_parser_spec.js index 38f630000..e4c9f287b 100644 --- a/test/unit/cff_parser_spec.js +++ b/test/unit/cff_parser_spec.js @@ -1,6 +1,5 @@ -/* globals describe, it, expect, beforeAll, afterAll, beforeEach, afterEach, - Stream, CFFParser, SEAC_ANALYSIS_ENABLED, CFFIndex, CFFStrings, - CFFCompiler */ +/* globals Stream, CFFParser, SEAC_ANALYSIS_ENABLED, CFFIndex, CFFParser, + CFFStrings, CFFCompiler */ 'use strict'; diff --git a/test/unit/cmap_spec.js b/test/unit/cmap_spec.js index 0ca9ee1d0..b77b23129 100644 --- a/test/unit/cmap_spec.js +++ b/test/unit/cmap_spec.js @@ -1,5 +1,4 @@ -/* globals expect, it, describe, StringStream, CMapFactory, Name, CMap, - IdentityCMap */ +/* globals StringStream, CMapFactory, CMap, IdentityCMap, Name */ 'use strict'; diff --git a/test/unit/crypto_spec.js b/test/unit/crypto_spec.js index f4b7aa2b5..2846996a2 100644 --- a/test/unit/crypto_spec.js +++ b/test/unit/crypto_spec.js @@ -1,7 +1,7 @@ -/* globals expect, it, describe, calculateMD5, ARCFourCipher, Name, beforeAll, - CipherTransformFactory, calculateSHA256, calculateSHA384, afterAll, - calculateSHA512, AES128Cipher, AES256Cipher, PDF17, PDF20, Dict, - PasswordException, PasswordResponses, stringToBytes */ +/* globals stringToBytes, calculateMD5, ARCFourCipher, calculateSHA256, + calculateSHA384, calculateSHA512, AES128Cipher, AES256Cipher, PDF17, + PDF20, Dict, CipherTransformFactory, PasswordException, + PasswordResponses, Name */ 'use strict'; @@ -482,6 +482,7 @@ describe('CipherTransformFactory', function() { function ensurePasswordNeeded(done, dict, fileId, password) { try { + // eslint-disable-next-line no-new new CipherTransformFactory(dict, fileId, password); } catch (ex) { expect(ex instanceof PasswordException).toEqual(true); @@ -495,6 +496,7 @@ describe('CipherTransformFactory', function() { function ensurePasswordIncorrect(done, dict, fileId, password) { try { + // eslint-disable-next-line no-new new CipherTransformFactory(dict, fileId, password); } catch (ex) { expect(ex instanceof PasswordException).toEqual(true); diff --git a/test/unit/dom_utils_spec.js b/test/unit/dom_utils_spec.js index 025fc3893..ce9148aad 100644 --- a/test/unit/dom_utils_spec.js +++ b/test/unit/dom_utils_spec.js @@ -1,5 +1,4 @@ -/* globals expect, it, describe, PDFJS, isExternalLinkTargetSet, LinkTarget, - getFilenameFromUrl, beforeAll, afterAll */ +/* globals getFilenameFromUrl, PDFJS, LinkTarget, isExternalLinkTargetSet */ 'use strict'; diff --git a/test/unit/evaluator_spec.js b/test/unit/evaluator_spec.js index e3c25718c..d64f26f4d 100644 --- a/test/unit/evaluator_spec.js +++ b/test/unit/evaluator_spec.js @@ -1,5 +1,5 @@ -/* globals expect, it, describe, PartialEvaluator, StringStream, OPS, - OperatorList, Dict, Name, Stream, WorkerTask */ +/* globals OperatorList, WorkerTask, PartialEvaluator, StringStream, OPS, Dict, + Name, Stream */ 'use strict'; diff --git a/test/unit/fonts_spec.js b/test/unit/fonts_spec.js index 3f2d9c598..2d5d0390a 100644 --- a/test/unit/fonts_spec.js +++ b/test/unit/fonts_spec.js @@ -1,4 +1,4 @@ -/* globals describe, it, expect, checkProblematicCharRanges */ +/* globals checkProblematicCharRanges */ 'use strict'; diff --git a/test/unit/function_spec.js b/test/unit/function_spec.js index e699a551a..2e1929ed1 100644 --- a/test/unit/function_spec.js +++ b/test/unit/function_spec.js @@ -1,6 +1,5 @@ -/* globals jasmine, expect, it, describe, beforeEach, isArray, StringStream, - PostScriptParser, PostScriptLexer, PostScriptEvaluator, - PostScriptCompiler*/ +/* globals isArray, StringStream, PostScriptParser, PostScriptLexer, + PostScriptEvaluator, PostScriptCompiler */ 'use strict'; @@ -433,7 +432,7 @@ describe('function', function() { expect(compiledCode).toBeNull(); } else { expect(compiledCode).not.toBeNull(); - /*jshint -W054 */ + // eslint-disable-next-line no-new-func var fn = new Function('src', 'srcOffset', 'dest', 'destOffset', compiledCode); for (var i = 0; i < samples.length; i++) { diff --git a/test/unit/jasmine-boot.js b/test/unit/jasmine-boot.js index 03cdfcb81..4e71d37cf 100644 --- a/test/unit/jasmine-boot.js +++ b/test/unit/jasmine-boot.js @@ -34,7 +34,7 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*globals jasmineRequire, jasmine, TestReporter */ +/* globals jasmineRequire, TestReporter */ // Modified jasmine's boot.js file to load PDF.js libraries async. diff --git a/test/unit/metadata_spec.js b/test/unit/metadata_spec.js index 20f92287c..d3cf09c70 100644 --- a/test/unit/metadata_spec.js +++ b/test/unit/metadata_spec.js @@ -1,4 +1,4 @@ -/* globals expect, it, describe, Metadata */ +/* globals Metadata */ 'use strict'; diff --git a/test/unit/murmurhash3_spec.js b/test/unit/murmurhash3_spec.js index 69865da4c..d1e731faf 100644 --- a/test/unit/murmurhash3_spec.js +++ b/test/unit/murmurhash3_spec.js @@ -1,4 +1,4 @@ -/* globals jasmine, expect, it, describe, MurmurHash3_64 */ +/* globals MurmurHash3_64 */ 'use strict'; @@ -49,4 +49,4 @@ describe('MurmurHash3_64', function() { hexdigest2 = hash.hexdigest(); expect(hexdigest1).not.toEqual(hexdigest2); }); -}); \ No newline at end of file +}); diff --git a/test/unit/network_spec.js b/test/unit/network_spec.js index fe19fb2b7..61f62b453 100644 --- a/test/unit/network_spec.js +++ b/test/unit/network_spec.js @@ -1,4 +1,4 @@ -/* globals expect, it, describe, PDFNetworkStream */ +/* globals PDFNetworkStream */ 'use strict'; diff --git a/test/unit/parser_spec.js b/test/unit/parser_spec.js index 8f4ac785c..953702288 100644 --- a/test/unit/parser_spec.js +++ b/test/unit/parser_spec.js @@ -1,4 +1,4 @@ -/* globals expect, it, describe, StringStream, Lexer, Name, Linearization */ +/* globals StringStream, Lexer, Name, Linearization */ 'use strict'; diff --git a/test/unit/stream_spec.js b/test/unit/stream_spec.js index 2d44de8a9..ced87137b 100644 --- a/test/unit/stream_spec.js +++ b/test/unit/stream_spec.js @@ -1,5 +1,4 @@ -/* globals jasmine, expect, it, describe, beforeEach, Stream, PredictorStream, - Dict */ +/* globals Stream, PredictorStream, Dict */ 'use strict'; diff --git a/test/unit/testreporter.js b/test/unit/testreporter.js index 594ad9391..c22a9edf3 100644 --- a/test/unit/testreporter.js +++ b/test/unit/testreporter.js @@ -1,4 +1,3 @@ - 'use strict'; var TestReporter = function(browser, appPath) { diff --git a/test/unit/type1_parser_spec.js b/test/unit/type1_parser_spec.js index cc8825e82..979871454 100644 --- a/test/unit/type1_parser_spec.js +++ b/test/unit/type1_parser_spec.js @@ -1,5 +1,4 @@ -/* globals describe, it, expect, StringStream, Type1Parser, - SEAC_ANALYSIS_ENABLED */ +/* globals StringStream, Type1Parser, SEAC_ANALYSIS_ENABLED */ 'use strict'; diff --git a/test/unit/unicode_spec.js b/test/unit/unicode_spec.js index 7b9d3f32e..e7e00c29d 100644 --- a/test/unit/unicode_spec.js +++ b/test/unit/unicode_spec.js @@ -1,6 +1,6 @@ -/* globals describe, it, expect, beforeAll, afterAll, mapSpecialUnicodeValues, - getUnicodeForGlyph, getGlyphsUnicode, getDingbatsGlyphsUnicode, - getUnicodeRangeFor, getNormalizedUnicodes, reverseIfRtl */ +/* globals mapSpecialUnicodeValues, getUnicodeForGlyph, getGlyphsUnicode, + getDingbatsGlyphsUnicode, getUnicodeRangeFor, getNormalizedUnicodes, + reverseIfRtl */ 'use strict'; diff --git a/test/unit/util_spec.js b/test/unit/util_spec.js index 655e2dc18..2dfaedb66 100644 --- a/test/unit/util_spec.js +++ b/test/unit/util_spec.js @@ -1,4 +1,4 @@ -/* globals describe, it, expect, stringToPDFString, removeNullCharacters */ +/* globals stringToPDFString, removeNullCharacters */ 'use strict'; diff --git a/test/webbrowser.js b/test/webbrowser.js index 0e6934020..4cb1b4d1b 100644 --- a/test/webbrowser.js +++ b/test/webbrowser.js @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/*jslint node: true */ 'use strict'; diff --git a/test/webserver.js b/test/webserver.js index 8149fd197..8f72760f8 100644 --- a/test/webserver.js +++ b/test/webserver.js @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/*jslint node: true */ 'use strict'; diff --git a/web/chromecom.js b/web/chromecom.js index 899948036..31d567d5f 100644 --- a/web/chromecom.js +++ b/web/chromecom.js @@ -12,8 +12,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - /* globals chrome, DEFAULT_URL */ + 'use strict'; (function (root, factory) { @@ -201,9 +201,11 @@ // Use Chrome's definition of UI language instead of PDF.js's #lang=..., // because the shown string should match the UI at chrome://extensions. // These strings are from chrome/app/resources/generated_resources_*.xtb. + /* eslint-disable no-unexpected-multiline */ var i18nFileAccessLabel = PDFJSDev.json('$ROOT/web/chrome-i18n-allow-access-to-file-urls.json') [chrome.i18n.getUILanguage && chrome.i18n.getUILanguage()]; + /* eslint-enable no-unexpected-multiline */ if (i18nFileAccessLabel) { document.getElementById('chrome-file-access-label').textContent = diff --git a/web/compatibility.js b/web/compatibility.js index 4300686e5..9946c4b1e 100644 --- a/web/compatibility.js +++ b/web/compatibility.js @@ -12,6 +12,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +/* eslint strict: ["error", "function"] */ +/* eslint-disable no-extend-native */ /* globals VBArray, PDFJS */ (function compatibilityWrapper() { diff --git a/web/download_manager.js b/web/download_manager.js index 75c151038..674dfb622 100644 --- a/web/download_manager.js +++ b/web/download_manager.js @@ -26,7 +26,7 @@ } }(this, function (exports, pdfjsLib) { if (typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC || CHROME')) { - /* jshint -W082 */ + // eslint-disable-next-line no-inner-declarations function download(blobUrl, filename) { var a = document.createElement('a'); if (a.click) { @@ -63,7 +63,7 @@ if (typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC || CHROME')) { } } - function DownloadManager() {} + function DownloadManager() {} // eslint-disable-line no-inner-declarations DownloadManager.prototype = { downloadUrl: function DownloadManager_downloadUrl(url, filename) { diff --git a/web/grab_to_pan.js b/web/grab_to_pan.js index 8eaae7766..803bdaa62 100644 --- a/web/grab_to_pan.js +++ b/web/grab_to_pan.js @@ -122,7 +122,7 @@ } if (event.originalTarget) { try { - /* jshint expr:true */ + // eslint-disable-next-line no-unused-expressions event.originalTarget.tagName; } catch (e) { // Mozilla-specific: element is a scrollbar (XUL element) diff --git a/web/pdf_viewer.component.js b/web/pdf_viewer.component.js index 05f3fdea0..14c22d1c1 100644 --- a/web/pdf_viewer.component.js +++ b/web/pdf_viewer.component.js @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* jshint globalstrict: false */ +/* eslint strict: ["error", "function"] */ /* umdutils ignore */ (function (root, factory) { diff --git a/web/preferences.js b/web/preferences.js index 478a0a87d..49907315e 100644 --- a/web/preferences.js +++ b/web/preferences.js @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* globals DEFAULT_PREFERENCES, chrome */ +/* globals DEFAULT_PREFERENCES */ 'use strict'; diff --git a/web/viewer.js b/web/viewer.js index d3dd4507a..a743e7e08 100644 --- a/web/viewer.js +++ b/web/viewer.js @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/*globals require, chrome */ +/* globals chrome */ 'use strict';