Browse Source

Merge pull request #7897 from Snuffleupagus/eslint-switch

Switch to using ESLint, instead of JSHint, for linting
Tim van der Meij 8 years ago committed by GitHub
parent
commit
a719b71e59
  1. 0
      .eslintignore
  2. 108
      .eslintrc
  3. 33
      .jshintrc
  4. 3
      examples/mobile-viewer/viewer.js
  5. 1
      extensions/chromium/options/migration.js
  6. 2
      extensions/chromium/options/options.js
  7. 1
      extensions/chromium/pdfHandler-vcros.js
  8. 1
      extensions/chromium/telemetry.js
  9. 9
      extensions/firefox/.eslintrc
  10. 1
      extensions/firefox/bootstrap.js
  11. 1
      extensions/firefox/chrome/content.js
  12. 2
      extensions/firefox/content/PdfJs-stub.jsm
  13. 1
      extensions/firefox/content/PdfJs.jsm
  14. 2
      extensions/firefox/content/PdfJsTelemetry-addon.jsm
  15. 2
      extensions/firefox/content/PdfJsTelemetry.jsm
  16. 1
      extensions/firefox/content/PdfStreamConverter.jsm
  17. 1
      extensions/firefox/content/PdfjsChromeUtils.jsm
  18. 1
      extensions/firefox/content/PdfjsContentUtils.jsm
  19. 1
      extensions/firefox/content/pdfjschildbootstrap.js
  20. 1
      extensions/firefox/tools/l10n.js
  21. 10
      external/.eslintrc
  22. 7
      external/builder/builder.js
  23. 11
      external/builder/fixtures/.eslintrc
  24. 14
      external/builder/preprocessor2.js
  25. 2
      external/builder/test.js
  26. 2
      external/builder/test2.js
  27. 3
      external/crlfchecker/crlfchecker.js
  28. 1
      external/crlfchecker/normtext.js
  29. 1
      external/importL10n/locales.js
  30. 12
      gulpfile.js
  31. 4
      make.js
  32. 2
      package.json
  33. 2
      src/core/fonts.js
  34. 2
      src/core/function.js
  35. 1
      src/core/jpg.js
  36. 2
      src/core/murmurhash3.js
  37. 14
      src/core/parser.js
  38. 1
      src/core/pattern.js
  39. 11
      src/core/worker.js
  40. 2
      src/display/api.js
  41. 1
      src/display/canvas.js
  42. 3
      src/display/font_loader.js
  43. 1
      src/display/metadata.js
  44. 2
      src/display/svg.js
  45. 1
      src/display/text_layer.js
  46. 2
      src/display/webgl.js
  47. 1
      src/doc_helper.js
  48. 2
      src/pdf.js
  49. 2
      src/pdf.worker.entry.js
  50. 2
      src/shared/fonts_utils.js
  51. 9
      src/shared/util.js
  52. 11
      test/.eslintrc
  53. 1
      test/downloadutils.js
  54. 2
      test/font/jasmine-boot.js
  55. 1
      test/font/ttxdriver.js
  56. 2
      test/stats/statcmp.js
  57. 1
      test/test.js
  58. 1
      test/testutils.js
  59. 9
      test/unit/annotation_layer_spec.js
  60. 7
      test/unit/api_spec.js
  61. 5
      test/unit/cff_parser_spec.js
  62. 3
      test/unit/cmap_spec.js
  63. 10
      test/unit/crypto_spec.js
  64. 3
      test/unit/dom_utils_spec.js
  65. 4
      test/unit/evaluator_spec.js
  66. 2
      test/unit/fonts_spec.js
  67. 7
      test/unit/function_spec.js
  68. 2
      test/unit/jasmine-boot.js
  69. 2
      test/unit/metadata_spec.js
  70. 4
      test/unit/murmurhash3_spec.js
  71. 2
      test/unit/network_spec.js
  72. 2
      test/unit/parser_spec.js
  73. 3
      test/unit/stream_spec.js
  74. 1
      test/unit/testreporter.js
  75. 3
      test/unit/type1_parser_spec.js
  76. 6
      test/unit/unicode_spec.js
  77. 2
      test/unit/util_spec.js
  78. 1
      test/webbrowser.js
  79. 1
      test/webserver.js
  80. 4
      web/chromecom.js
  81. 2
      web/compatibility.js
  82. 4
      web/download_manager.js
  83. 2
      web/grab_to_pan.js
  84. 2
      web/pdf_viewer.component.js
  85. 2
      web/preferences.js
  86. 2
      web/viewer.js

0
.jshintignore → .eslintignore

108
.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, }, }],
},
}

33
.jshintrc

@ -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
}

3
examples/mobile-viewer/viewer.js

@ -12,8 +12,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* globals PDFJS */
/* globals PDFJS, Promise */
'use strict'; 'use strict';

1
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 See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/* eslint strict: ["error", "function"] */
/* globals chrome */ /* globals chrome */
(function() { (function() {

2
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 See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/* globals chrome, Promise */ /* globals chrome */
'use strict'; 'use strict';
var storageAreaName = chrome.storage.sync ? 'sync' : 'local'; var storageAreaName = chrome.storage.sync ? 'sync' : 'local';

1
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 See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/* eslint strict: ["error", "function"] */
/* globals chrome, getViewerURL */ /* globals chrome, getViewerURL */
(function() { (function() {

1
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 See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/* eslint strict: ["error", "function"] */
/* globals chrome, crypto, Headers, Request */ /* globals chrome, crypto, Headers, Request */
(function() { (function() {

9
extensions/firefox/.eslintrc

@ -0,0 +1,9 @@
{
"extends": [
../../.eslintrc
],
"parserOptions": {
"ecmaVersion": 6
},
}

1
extensions/firefox/bootstrap.js vendored

@ -12,7 +12,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* jshint esnext:true */
/* globals Components, Services, dump, XPCOMUtils, PdfStreamConverter, /* globals Components, Services, dump, XPCOMUtils, PdfStreamConverter,
APP_SHUTDOWN, PdfjsChromeUtils, PdfjsContentUtils */ APP_SHUTDOWN, PdfjsChromeUtils, PdfjsContentUtils */

1
extensions/firefox/chrome/content.js

@ -12,7 +12,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* jshint esnext:true */
/* globals Components, Services, XPCOMUtils, PdfjsContentUtils, /* globals Components, Services, XPCOMUtils, PdfjsContentUtils,
PdfjsContentUtils, PdfStreamConverter, addMessageListener */ PdfjsContentUtils, PdfStreamConverter, addMessageListener */

2
extensions/firefox/content/PdfJs-stub.jsm

@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* jshint esnext:true, maxlen:100 */ /* eslint max-len: ["error", 100] */
'use strict'; 'use strict';

1
extensions/firefox/content/PdfJs.jsm

@ -12,7 +12,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* jshint esnext:true */
/* globals Components, Services, XPCOMUtils, PdfjsChromeUtils, /* globals Components, Services, XPCOMUtils, PdfjsChromeUtils,
PdfjsContentUtils, PdfStreamConverter */ PdfjsContentUtils, PdfStreamConverter */

2
extensions/firefox/content/PdfJsTelemetry-addon.jsm

@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* jshint esnext:true, maxlen:120 */ /* eslint max-len: ["error", 120] */
/* globals Components, Services */ /* globals Components, Services */
'use strict'; 'use strict';

2
extensions/firefox/content/PdfJsTelemetry.jsm

@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* jshint esnext:true, maxlen: 100 */ /* eslint max-len: ["error", 100] */
/* globals Components, Services */ /* globals Components, Services */
'use strict'; 'use strict';

1
extensions/firefox/content/PdfStreamConverter.jsm

@ -12,7 +12,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* jshint esnext:true */
/* globals Components, Services, XPCOMUtils, NetUtil, PrivateBrowsingUtils, /* globals Components, Services, XPCOMUtils, NetUtil, PrivateBrowsingUtils,
dump, NetworkManager, PdfJsTelemetry, PdfjsContentUtils */ dump, NetworkManager, PdfJsTelemetry, PdfjsContentUtils */

1
extensions/firefox/content/PdfjsChromeUtils.jsm

@ -12,7 +12,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* jshint esnext:true */
/* globals Components, Services, XPCOMUtils */ /* globals Components, Services, XPCOMUtils */
'use strict'; 'use strict';

1
extensions/firefox/content/PdfjsContentUtils.jsm

@ -12,7 +12,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* jshint esnext:true */
/* globals Components, Services, XPCOMUtils */ /* globals Components, Services, XPCOMUtils */
'use strict'; 'use strict';

1
extensions/firefox/content/pdfjschildbootstrap.js vendored

@ -12,7 +12,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* jshint esnext:true */
/* globals Components, PdfjsContentUtils, PdfJs, Services */ /* globals Components, PdfjsContentUtils, PdfJs, Services */
'use strict'; 'use strict';

1
extensions/firefox/tools/l10n.js

@ -1,4 +1,3 @@
'use strict'; 'use strict';
// Small subset of the webL10n API by Fabien Cazenave for pdf.js extension. // Small subset of the webL10n API by Fabien Cazenave for pdf.js extension.

10
external/.eslintrc vendored

@ -0,0 +1,10 @@
{
"extends": [
../.eslintrc
],
"env": {
"node": true,
"shelljs": true,
},
}

7
external/builder/builder.js vendored

@ -1,6 +1,3 @@
/* jshint node:true */
/* globals cp, ls, test */
'use strict'; 'use strict';
var fs = require('fs'), var fs = require('fs'),
@ -107,10 +104,8 @@ function preprocess(inFilename, outFilename, defines) {
var line; var line;
var state = STATE_NONE; var state = STATE_NONE;
var stack = []; var stack = [];
var control = var control = // eslint-disable-next-line max-len
/* jshint -W101 */
/^(?:\/\/|<!--)\s*#(if|elif|else|endif|expand|include|error)\b(?:\s+(.*?)(?:-->)?$)?/; /^(?:\/\/|<!--)\s*#(if|elif|else|endif|expand|include|error)\b(?:\s+(.*?)(?:-->)?$)?/;
/* jshint +W101 */
var lineNumber = 0; var lineNumber = 0;
var loc = function() { var loc = function() {
return fs.realpathSync(inFilename) + ':' + lineNumber; return fs.realpathSync(inFilename) + ':' + lineNumber;

11
external/builder/fixtures/.eslintrc vendored

@ -0,0 +1,11 @@
{
"extends": [
../../.eslintrc
],
"rules": {
"no-empty": "off",
"keyword-spacing": "off",
"space-infix-ops": "off",
},
}

14
external/builder/preprocessor2.js vendored

@ -1,5 +1,3 @@
/* jshint node:true */
'use strict'; 'use strict';
var esprima = require('esprima'); var esprima = require('esprima');
@ -197,8 +195,12 @@ function fixComments(ctx, node) {
} }
// Fixes double comments in the escodegen output. // Fixes double comments in the escodegen output.
delete node.trailingComments; delete node.trailingComments;
// Removes jshint and other service comments. // Removes ESLint and other service comments.
if (node.leadingComments) { 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; var i = 0;
while (i < node.leadingComments.length) { while (i < node.leadingComments.length) {
var type = node.leadingComments[i].type; var type = node.leadingComments[i].type;
@ -206,12 +208,12 @@ function fixComments(ctx, node) {
if (ctx.saveComments === 'copyright') { if (ctx.saveComments === 'copyright') {
// Remove all comments, except Copyright notices and License headers. // 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); node.leadingComments.splice(i, 1);
continue; continue;
} }
} else if (type === 'Block' && } else if ((type === 'Block' && BlockCommentRegExp.test(value)) ||
/^\s*(globals|jshint|falls through|umdutils)\b/.test(value)) { (type === 'Line' && LineCommentRegExp.test(value))) {
node.leadingComments.splice(i, 1); node.leadingComments.splice(i, 1);
continue; continue;
} }

2
external/builder/test.js vendored

@ -1,5 +1,3 @@
/* jshint node:true */
/* globals cat, cd, echo, ls */
'use strict'; 'use strict';
require('shelljs/make'); require('shelljs/make');

2
external/builder/test2.js vendored

@ -1,5 +1,3 @@
/* jshint node:true */
/* globals cat, cd, echo, ls */
'use strict'; 'use strict';
require('shelljs/make'); require('shelljs/make');

3
external/crlfchecker/crlfchecker.js vendored

@ -1,6 +1,3 @@
/* jshint node:true */
/* globals cat, echo, exit, ls */
'use strict'; 'use strict';
function checkIfCrlfIsPresent(files) { function checkIfCrlfIsPresent(files) {

1
external/crlfchecker/normtext.js vendored

@ -12,7 +12,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* jshint node:true */
'use strict'; 'use strict';

1
external/importL10n/locales.js vendored

@ -12,7 +12,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* jshint node:true */
'use strict'; 'use strict';

12
gulpfile.js

@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* jshint node:true */ /* eslint-env node */
/* globals target */ /* globals target */
'use strict'; 'use strict';
@ -529,12 +529,12 @@ gulp.task('lint', function (done) {
console.log(); console.log();
console.log('### Linting JS files'); console.log('### Linting JS files');
// Lint the Firefox specific *.jsm files. // Ensure that we lint the Firefox specific *.jsm files too.
var options = ['node_modules/jshint/bin/jshint', '--extra-ext', '.jsm', '.']; var options = ['node_modules/eslint/bin/eslint', '--ext', '.js,.jsm', '.'];
var jshintProcess = spawn('node', options, {stdio: 'inherit'}); var esLintProcess = spawn('node', options, {stdio: 'inherit'});
jshintProcess.on('close', function (code) { esLintProcess.on('close', function (code) {
if (code !== 0) { if (code !== 0) {
done(new Error('jshint failed.')); done(new Error('ESLint failed.'));
return; return;
} }

4
make.js

@ -12,9 +12,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* jshint node:true */ /* eslint-env node, shelljs */
/* globals cat, cd, cp, echo, env, exec, exit, find, ls, mkdir, mv, process, rm,
sed, target, test */
'use strict'; 'use strict';

2
package.json

@ -3,13 +3,13 @@
"version": "0.8.0", "version": "0.8.0",
"devDependencies": { "devDependencies": {
"escodegen": "^1.8.0", "escodegen": "^1.8.0",
"eslint": "^3.11.1",
"esprima": "^2.7.2", "esprima": "^2.7.2",
"gulp": "^3.9.1", "gulp": "^3.9.1",
"gulp-util": "^3.0.7", "gulp-util": "^3.0.7",
"gulp-zip": "^3.2.0", "gulp-zip": "^3.2.0",
"jasmine-core": "^2.4.1", "jasmine-core": "^2.4.1",
"jsdoc": "^3.3.0-alpha9", "jsdoc": "^3.3.0-alpha9",
"jshint": "~2.8.0",
"mkdirp": "^0.5.1", "mkdirp": "^0.5.1",
"node-ensure": "^0.0.0", "node-ensure": "^0.0.0",
"requirejs": "^2.1.22", "requirejs": "^2.1.22",

2
src/core/fonts.js

@ -983,7 +983,7 @@ var Font = (function FontClosure() {
// Split the sorted codes into ranges. // Split the sorted codes into ranges.
var ranges = []; var ranges = [];
var length = codes.length; 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 start = codes[n].fontCharCode;
var codeIndices = [codes[n].glyphId]; var codeIndices = [codes[n].glyphId];
++n; ++n;

2
src/core/function.js

@ -423,7 +423,7 @@ var PDFFunction = (function PDFFunctionClosure() {
// Compiled function consists of simple expressions such as addition, // Compiled function consists of simple expressions such as addition,
// subtraction, Math.max, and also contains 'var' and 'return' // subtraction, Math.max, and also contains 'var' and 'return'
// statements. See the generation in the PostScriptCompiler below. // 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); return new Function('src', 'srcOffset', 'dest', 'destOffset', compiled);
} }

1
src/core/jpg.js

@ -12,6 +12,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* eslint-disable no-multi-spaces */
'use strict'; 'use strict';

2
src/core/murmurhash3.js

@ -1,4 +1,3 @@
/* Copyright 2014 Opera Software ASA /* Copyright 2014 Opera Software ASA
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * 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')) { !PDFJSDev.test('FIREFOX || MOZCENTRAL || CHROME')) {
// old webkits have issues with non-aligned arrays // old webkits have issues with non-aligned arrays
try { try {
// eslint-disable-next-line no-new
new Uint32Array(new Uint8Array(5).buffer, 0, 1); new Uint32Array(new Uint8Array(5).buffer, 0, 1);
} catch (e) { } catch (e) {
alwaysUseUint32ArrayView = true; alwaysUseUint32ArrayView = true;

14
src/core/parser.js

@ -248,29 +248,29 @@ var Parser = (function ParserClosure() {
case 0xC1: // SOF1 case 0xC1: // SOF1
case 0xC2: // SOF2 case 0xC2: // SOF2
case 0xC3: // SOF3 case 0xC3: // SOF3
/* falls through */
case 0xC5: // SOF5 case 0xC5: // SOF5
case 0xC6: // SOF6 case 0xC6: // SOF6
case 0xC7: // SOF7 case 0xC7: // SOF7
/* falls through */
case 0xC9: // SOF9 case 0xC9: // SOF9
case 0xCA: // SOF10 case 0xCA: // SOF10
case 0xCB: // SOF11 case 0xCB: // SOF11
/* falls through */
case 0xCD: // SOF13 case 0xCD: // SOF13
case 0xCE: // SOF14 case 0xCE: // SOF14
case 0xCF: // SOF15 case 0xCF: // SOF15
/* falls through */
case 0xC4: // DHT case 0xC4: // DHT
case 0xCC: // DAC case 0xCC: // DAC
/* falls through */
case 0xDA: // SOS case 0xDA: // SOS
case 0xDB: // DQT case 0xDB: // DQT
case 0xDC: // DNL case 0xDC: // DNL
case 0xDD: // DRI case 0xDD: // DRI
case 0xDE: // DHP case 0xDE: // DHP
case 0xDF: // EXP case 0xDF: // EXP
/* falls through */
case 0xE0: // APP0 case 0xE0: // APP0
case 0xE1: // APP1 case 0xE1: // APP1
case 0xE2: // APP2 case 0xE2: // APP2
@ -287,7 +287,7 @@ var Parser = (function ParserClosure() {
case 0xED: // APP13 case 0xED: // APP13
case 0xEE: // APP14 case 0xEE: // APP14
case 0xEF: // APP15 case 0xEF: // APP15
/* falls through */
case 0xFE: // COM case 0xFE: // COM
// The marker should be followed by the length of the segment. // The marker should be followed by the length of the segment.
markerLength = stream.getUint16(); markerLength = stream.getUint16();

1
src/core/pattern.js

@ -12,6 +12,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* eslint-disable no-multi-spaces */
'use strict'; 'use strict';

11
src/core/worker.js

@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* globals NetworkManager, module */ /* globals module */
'use strict'; 'use strict';
@ -83,14 +83,13 @@ var WorkerTask = (function WorkerTaskClosure() {
})(); })();
if (typeof PDFJSDev === 'undefined' || !PDFJSDev.test('PRODUCTION')) { if (typeof PDFJSDev === 'undefined' || !PDFJSDev.test('PRODUCTION')) {
/*jshint -W082 */
/** /**
* Interface that represents PDF data transport. If possible, it allows * Interface that represents PDF data transport. If possible, it allows
* progressively load entire or fragment of the PDF binary data. * progressively load entire or fragment of the PDF binary data.
* *
* @interface * @interface
* */ */
function IPDFStream() {} function IPDFStream() {} // eslint-disable-line no-inner-declarations
IPDFStream.prototype = { IPDFStream.prototype = {
/** /**
* Gets a reader for the entire PDF data. * Gets a reader for the entire PDF data.
@ -118,7 +117,7 @@ IPDFStream.prototype = {
* *
* @interface * @interface
*/ */
function IPDFStreamReader() {} function IPDFStreamReader() {} // eslint-disable-line no-inner-declarations
IPDFStreamReader.prototype = { IPDFStreamReader.prototype = {
/** /**
* Gets a promise that is resolved when the headers and other metadata of * Gets a promise that is resolved when the headers and other metadata of
@ -179,7 +178,7 @@ IPDFStreamReader.prototype = {
* *
* @interface * @interface
*/ */
function IPDFStreamRangeReader() {} function IPDFStreamRangeReader() {} // eslint-disable-line no-inner-declarations
IPDFStreamRangeReader.prototype = { IPDFStreamRangeReader.prototype = {
/** /**
* Gets ability of the stream to progressively load binary data. * Gets ability of the stream to progressively load binary data.

2
src/display/api.js

@ -13,7 +13,7 @@
* limitations under the License. * limitations under the License.
*/ */
/* globals pdfjsFilePath, pdfjsVersion, pdfjsBuild, requirejs, pdfjsLibs, /* globals pdfjsFilePath, pdfjsVersion, pdfjsBuild, requirejs, pdfjsLibs,
WeakMap */ __webpack_require__ */
'use strict'; 'use strict';

1
src/display/canvas.js

@ -12,7 +12,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* globals ImageData */
'use strict'; 'use strict';

3
src/display/font_loader.js

@ -12,7 +12,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* globals FontFace */
'use strict'; 'use strict';
@ -426,7 +425,7 @@ var FontFaceObject = (function FontFaceObjectClosure() {
js += 'c.' + current.cmd + '(' + args + ');\n'; js += 'c.' + current.cmd + '(' + args + ');\n';
} }
/* jshint -W054 */ // eslint-disable-next-line no-new-func
this.compiledGlyphs[character] = new Function('c', 'size', js); this.compiledGlyphs[character] = new Function('c', 'size', js);
} else { } else {
// But fall back on using Function.prototype.apply() if we're // But fall back on using Function.prototype.apply() if we're

1
src/display/metadata.js

@ -12,7 +12,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* globals Document */
'use strict'; 'use strict';

2
src/display/svg.js

@ -460,7 +460,7 @@ var SVGGraphics = (function SVGGraphicsClosure() {
convertOpList: function SVGGraphics_convertOpList(operatorList) { convertOpList: function SVGGraphics_convertOpList(operatorList) {
var argsArray = operatorList.argsArray; var argsArray = operatorList.argsArray;
var fnArray = operatorList.fnArray; var fnArray = operatorList.fnArray;
var fnArrayLen = fnArray.length; var fnArrayLen = fnArray.length;
var REVOPS = []; var REVOPS = [];
var opList = []; var opList = [];

1
src/display/text_layer.js

@ -12,7 +12,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* globals WeakMap */
'use strict'; 'use strict';

2
src/display/webgl.js

@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* jshint -W043 */ /* eslint-disable no-multi-str */
'use strict'; 'use strict';

1
src/doc_helper.js

@ -12,6 +12,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* eslint-disable strict */
/* /*
NOTE: This file is created as a helper to assist with JSDoc html files. NOTE: This file is created as a helper to assist with JSDoc html files.

2
src/pdf.js

@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* jshint globalstrict: false */ /* eslint strict: ["error", "function"] */
/* umdutils ignore */ /* umdutils ignore */
(function (root, factory) { (function (root, factory) {

2
src/pdf.worker.entry.js

@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* eslint-disable strict */
(typeof window !== 'undefined' ? window : {}).pdfjsDistBuildPdfWorker = (typeof window !== 'undefined' ? window : {}).pdfjsDistBuildPdfWorker =
require('./pdf.worker.js'); require('./pdf.worker.js');

2
src/shared/fonts_utils.js

@ -73,7 +73,7 @@ function readCharstringEncoding(aString) {
var charstringTokens = []; var charstringTokens = [];
var count = aString.length; 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 value = aString[i++] | 0;
var token = null; var token = null;

9
src/shared/util.js

@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* globals URL, global */ /* globals global */
'use strict'; 'use strict';
@ -620,8 +620,7 @@ function isLittleEndian() {
// Checks if it's possible to eval JS expressions. // Checks if it's possible to eval JS expressions.
function isEvalSupported() { function isEvalSupported() {
try { try {
/* jshint evil: true */ new Function(''); // eslint-disable-line no-new, no-new-func
new Function('');
return true; return true;
} catch (e) { } catch (e) {
return false; return false;
@ -1756,6 +1755,8 @@ if (typeof PDFJSDev === 'undefined' || !PDFJSDev.test('MOZCENTRAL')) {
/* Any copyright is dedicated to the Public Domain. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * http://creativecommons.org/publicdomain/zero/1.0/ */
(function checkURLConstructor(scope) { (function checkURLConstructor(scope) {
/* eslint-disable yoda */
// feature detect for URL constructor // feature detect for URL constructor
var hasWorkingUrl = false; var hasWorkingUrl = false;
try { try {
@ -2392,6 +2393,8 @@ if (typeof PDFJSDev === 'undefined' || !PDFJSDev.test('MOZCENTRAL')) {
} }
scope.URL = JURL; scope.URL = JURL;
/* eslint-enable yoda */
})(globalScope); })(globalScope);
} }

11
test/.eslintrc

@ -0,0 +1,11 @@
{
"extends": [
../.eslintrc
],
"env": {
"node": true,
"shelljs": true,
"jasmine": true,
},
}

1
test/downloadutils.js

@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/*jslint node: true */
'use strict'; 'use strict';

2
test/font/jasmine-boot.js

@ -34,7 +34,7 @@
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 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. // Modified jasmine's boot.js file to load PDF.js libraries async.

1
test/font/ttxdriver.js

@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/*jslint node: true */
'use strict'; 'use strict';

2
test/stats/statcmp.js

@ -1,5 +1,3 @@
/*jslint node: true */
'use strict'; 'use strict';
var fs = require('fs'); var fs = require('fs');

1
test/test.js

@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/*jslint node: true */
'use strict'; 'use strict';

1
test/testutils.js

@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/*jslint node: true */
'use strict'; 'use strict';

9
test/unit/annotation_layer_spec.js

@ -1,8 +1,7 @@
/* globals expect, it, describe, Dict, Name, Annotation, AnnotationBorderStyle, /* globals isRef, AnnotationFactory, Dict, Name, Ref, AnnotationType,
AnnotationBorderStyleType, AnnotationType, AnnotationFlag, PDFJS, AnnotationFlag, Annotation, AnnotationBorderStyle,
beforeEach, afterEach, stringToBytes, AnnotationFactory, Ref, isRef, AnnotationBorderStyleType, StringStream, Lexer, Parser,
beforeAll, afterAll, AnnotationFieldFlag, stringToUTF8String, stringToUTF8String, AnnotationFieldFlag, PDFJS, stringToBytes */
StringStream, Lexer, Parser */
'use strict'; 'use strict';

7
test/unit/api_spec.js

@ -1,7 +1,6 @@
/* globals PDFJS, expect, it, describe, Promise, beforeAll, /* globals PDFJS, createPromiseCapability, PDFDocumentProxy,
InvalidPDFException, MissingPDFException, StreamType, FontType, InvalidPDFException, MissingPDFException, PasswordResponses,
PDFDocumentProxy, PasswordException, PasswordResponses, afterAll, PasswordException, PDFPageProxy, StreamType, FontType */
PDFPageProxy, createPromiseCapability, afterEach */
'use strict'; 'use strict';

5
test/unit/cff_parser_spec.js

@ -1,6 +1,5 @@
/* globals describe, it, expect, beforeAll, afterAll, beforeEach, afterEach, /* globals Stream, CFFParser, SEAC_ANALYSIS_ENABLED, CFFIndex, CFFParser,
Stream, CFFParser, SEAC_ANALYSIS_ENABLED, CFFIndex, CFFStrings, CFFStrings, CFFCompiler */
CFFCompiler */
'use strict'; 'use strict';

3
test/unit/cmap_spec.js

@ -1,5 +1,4 @@
/* globals expect, it, describe, StringStream, CMapFactory, Name, CMap, /* globals StringStream, CMapFactory, CMap, IdentityCMap, Name */
IdentityCMap */
'use strict'; 'use strict';

10
test/unit/crypto_spec.js

@ -1,7 +1,7 @@
/* globals expect, it, describe, calculateMD5, ARCFourCipher, Name, beforeAll, /* globals stringToBytes, calculateMD5, ARCFourCipher, calculateSHA256,
CipherTransformFactory, calculateSHA256, calculateSHA384, afterAll, calculateSHA384, calculateSHA512, AES128Cipher, AES256Cipher, PDF17,
calculateSHA512, AES128Cipher, AES256Cipher, PDF17, PDF20, Dict, PDF20, Dict, CipherTransformFactory, PasswordException,
PasswordException, PasswordResponses, stringToBytes */ PasswordResponses, Name */
'use strict'; 'use strict';
@ -482,6 +482,7 @@ describe('CipherTransformFactory', function() {
function ensurePasswordNeeded(done, dict, fileId, password) { function ensurePasswordNeeded(done, dict, fileId, password) {
try { try {
// eslint-disable-next-line no-new
new CipherTransformFactory(dict, fileId, password); new CipherTransformFactory(dict, fileId, password);
} catch (ex) { } catch (ex) {
expect(ex instanceof PasswordException).toEqual(true); expect(ex instanceof PasswordException).toEqual(true);
@ -495,6 +496,7 @@ describe('CipherTransformFactory', function() {
function ensurePasswordIncorrect(done, dict, fileId, password) { function ensurePasswordIncorrect(done, dict, fileId, password) {
try { try {
// eslint-disable-next-line no-new
new CipherTransformFactory(dict, fileId, password); new CipherTransformFactory(dict, fileId, password);
} catch (ex) { } catch (ex) {
expect(ex instanceof PasswordException).toEqual(true); expect(ex instanceof PasswordException).toEqual(true);

3
test/unit/dom_utils_spec.js

@ -1,5 +1,4 @@
/* globals expect, it, describe, PDFJS, isExternalLinkTargetSet, LinkTarget, /* globals getFilenameFromUrl, PDFJS, LinkTarget, isExternalLinkTargetSet */
getFilenameFromUrl, beforeAll, afterAll */
'use strict'; 'use strict';

4
test/unit/evaluator_spec.js

@ -1,5 +1,5 @@
/* globals expect, it, describe, PartialEvaluator, StringStream, OPS, /* globals OperatorList, WorkerTask, PartialEvaluator, StringStream, OPS, Dict,
OperatorList, Dict, Name, Stream, WorkerTask */ Name, Stream */
'use strict'; 'use strict';

2
test/unit/fonts_spec.js

@ -1,4 +1,4 @@
/* globals describe, it, expect, checkProblematicCharRanges */ /* globals checkProblematicCharRanges */
'use strict'; 'use strict';

7
test/unit/function_spec.js

@ -1,6 +1,5 @@
/* globals jasmine, expect, it, describe, beforeEach, isArray, StringStream, /* globals isArray, StringStream, PostScriptParser, PostScriptLexer,
PostScriptParser, PostScriptLexer, PostScriptEvaluator, PostScriptEvaluator, PostScriptCompiler */
PostScriptCompiler*/
'use strict'; 'use strict';
@ -433,7 +432,7 @@ describe('function', function() {
expect(compiledCode).toBeNull(); expect(compiledCode).toBeNull();
} else { } else {
expect(compiledCode).not.toBeNull(); expect(compiledCode).not.toBeNull();
/*jshint -W054 */ // eslint-disable-next-line no-new-func
var fn = new Function('src', 'srcOffset', 'dest', 'destOffset', var fn = new Function('src', 'srcOffset', 'dest', 'destOffset',
compiledCode); compiledCode);
for (var i = 0; i < samples.length; i++) { for (var i = 0; i < samples.length; i++) {

2
test/unit/jasmine-boot.js

@ -34,7 +34,7 @@
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 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. // Modified jasmine's boot.js file to load PDF.js libraries async.

2
test/unit/metadata_spec.js

@ -1,4 +1,4 @@
/* globals expect, it, describe, Metadata */ /* globals Metadata */
'use strict'; 'use strict';

4
test/unit/murmurhash3_spec.js

@ -1,4 +1,4 @@
/* globals jasmine, expect, it, describe, MurmurHash3_64 */ /* globals MurmurHash3_64 */
'use strict'; 'use strict';
@ -49,4 +49,4 @@ describe('MurmurHash3_64', function() {
hexdigest2 = hash.hexdigest(); hexdigest2 = hash.hexdigest();
expect(hexdigest1).not.toEqual(hexdigest2); expect(hexdigest1).not.toEqual(hexdigest2);
}); });
}); });

2
test/unit/network_spec.js

@ -1,4 +1,4 @@
/* globals expect, it, describe, PDFNetworkStream */ /* globals PDFNetworkStream */
'use strict'; 'use strict';

2
test/unit/parser_spec.js

@ -1,4 +1,4 @@
/* globals expect, it, describe, StringStream, Lexer, Name, Linearization */ /* globals StringStream, Lexer, Name, Linearization */
'use strict'; 'use strict';

3
test/unit/stream_spec.js

@ -1,5 +1,4 @@
/* globals jasmine, expect, it, describe, beforeEach, Stream, PredictorStream, /* globals Stream, PredictorStream, Dict */
Dict */
'use strict'; 'use strict';

1
test/unit/testreporter.js

@ -1,4 +1,3 @@
'use strict'; 'use strict';
var TestReporter = function(browser, appPath) { var TestReporter = function(browser, appPath) {

3
test/unit/type1_parser_spec.js

@ -1,5 +1,4 @@
/* globals describe, it, expect, StringStream, Type1Parser, /* globals StringStream, Type1Parser, SEAC_ANALYSIS_ENABLED */
SEAC_ANALYSIS_ENABLED */
'use strict'; 'use strict';

6
test/unit/unicode_spec.js

@ -1,6 +1,6 @@
/* globals describe, it, expect, beforeAll, afterAll, mapSpecialUnicodeValues, /* globals mapSpecialUnicodeValues, getUnicodeForGlyph, getGlyphsUnicode,
getUnicodeForGlyph, getGlyphsUnicode, getDingbatsGlyphsUnicode, getDingbatsGlyphsUnicode, getUnicodeRangeFor, getNormalizedUnicodes,
getUnicodeRangeFor, getNormalizedUnicodes, reverseIfRtl */ reverseIfRtl */
'use strict'; 'use strict';

2
test/unit/util_spec.js

@ -1,4 +1,4 @@
/* globals describe, it, expect, stringToPDFString, removeNullCharacters */ /* globals stringToPDFString, removeNullCharacters */
'use strict'; 'use strict';

1
test/webbrowser.js

@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/*jslint node: true */
'use strict'; 'use strict';

1
test/webserver.js

@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/*jslint node: true */
'use strict'; 'use strict';

4
web/chromecom.js

@ -12,8 +12,8 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* globals chrome, DEFAULT_URL */ /* globals chrome, DEFAULT_URL */
'use strict'; 'use strict';
(function (root, factory) { (function (root, factory) {
@ -201,9 +201,11 @@
// Use Chrome's definition of UI language instead of PDF.js's #lang=..., // Use Chrome's definition of UI language instead of PDF.js's #lang=...,
// because the shown string should match the UI at chrome://extensions. // because the shown string should match the UI at chrome://extensions.
// These strings are from chrome/app/resources/generated_resources_*.xtb. // These strings are from chrome/app/resources/generated_resources_*.xtb.
/* eslint-disable no-unexpected-multiline */
var i18nFileAccessLabel = var i18nFileAccessLabel =
PDFJSDev.json('$ROOT/web/chrome-i18n-allow-access-to-file-urls.json') PDFJSDev.json('$ROOT/web/chrome-i18n-allow-access-to-file-urls.json')
[chrome.i18n.getUILanguage && chrome.i18n.getUILanguage()]; [chrome.i18n.getUILanguage && chrome.i18n.getUILanguage()];
/* eslint-enable no-unexpected-multiline */
if (i18nFileAccessLabel) { if (i18nFileAccessLabel) {
document.getElementById('chrome-file-access-label').textContent = document.getElementById('chrome-file-access-label').textContent =

2
web/compatibility.js

@ -12,6 +12,8 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* eslint strict: ["error", "function"] */
/* eslint-disable no-extend-native */
/* globals VBArray, PDFJS */ /* globals VBArray, PDFJS */
(function compatibilityWrapper() { (function compatibilityWrapper() {

4
web/download_manager.js

@ -26,7 +26,7 @@
} }
}(this, function (exports, pdfjsLib) { }(this, function (exports, pdfjsLib) {
if (typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC || CHROME')) { if (typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC || CHROME')) {
/* jshint -W082 */ // eslint-disable-next-line no-inner-declarations
function download(blobUrl, filename) { function download(blobUrl, filename) {
var a = document.createElement('a'); var a = document.createElement('a');
if (a.click) { 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 = { DownloadManager.prototype = {
downloadUrl: function DownloadManager_downloadUrl(url, filename) { downloadUrl: function DownloadManager_downloadUrl(url, filename) {

2
web/grab_to_pan.js

@ -122,7 +122,7 @@
} }
if (event.originalTarget) { if (event.originalTarget) {
try { try {
/* jshint expr:true */ // eslint-disable-next-line no-unused-expressions
event.originalTarget.tagName; event.originalTarget.tagName;
} catch (e) { } catch (e) {
// Mozilla-specific: element is a scrollbar (XUL element) // Mozilla-specific: element is a scrollbar (XUL element)

2
web/pdf_viewer.component.js

@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* jshint globalstrict: false */ /* eslint strict: ["error", "function"] */
/* umdutils ignore */ /* umdutils ignore */
(function (root, factory) { (function (root, factory) {

2
web/preferences.js

@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* globals DEFAULT_PREFERENCES, chrome */ /* globals DEFAULT_PREFERENCES */
'use strict'; 'use strict';

2
web/viewer.js

@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/*globals require, chrome */ /* globals chrome */
'use strict'; 'use strict';

Loading…
Cancel
Save