Skip to content

Commit

Permalink
Enable the ESLint no-var rule in the external/ folder
Browse files Browse the repository at this point in the history
These changes were done automatically, by using the `gulp lint --fix` command.
  • Loading branch information
Snuffleupagus committed Mar 14, 2021
1 parent 67b866b commit 96d2a2f
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 48 deletions.
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ external/quickjs/
src/shared/cffStandardStrings.js
src/shared/fonts_utils.js
test/tmp/
test/features/
test/pdfs/
test/resources/
*~/
5 changes: 0 additions & 5 deletions external/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,4 @@
"env": {
"node": true,
},

"rules": {
// ECMAScript 6
"no-var": "off",
},
}
10 changes: 0 additions & 10 deletions external/builder/.eslintrc

This file was deleted.

10 changes: 0 additions & 10 deletions external/cmapscompress/.eslintrc

This file was deleted.

4 changes: 2 additions & 2 deletions external/dist/webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

"use strict";

var pdfjs = require("./build/pdf.js");
var PdfjsWorker = require("worker-loader?esModule=false&filename=[name].js!./build/pdf.worker.js");
const pdfjs = require("./build/pdf.js");
const PdfjsWorker = require("worker-loader?esModule=false&filename=[name].js!./build/pdf.worker.js");

if (typeof window !== "undefined" && "Worker" in window) {
pdfjs.GlobalWorkerOptions.workerPort = new PdfjsWorker();
Expand Down
10 changes: 0 additions & 10 deletions external/importL10n/.eslintrc

This file was deleted.

2 changes: 2 additions & 0 deletions external/systemjs/plugin-babel-cached.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-disable no-var */

var babel = require("plugin-babel");

var cacheExpiration = 60 /* min */ * 60 * 1000;
Expand Down
19 changes: 9 additions & 10 deletions external/webpack/pdfjsdev-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-env node */

"use strict";

var preprocessor2 = require("../builder/preprocessor2.js");
var path = require("path");
const preprocessor2 = require("../builder/preprocessor2.js");
const path = require("path");

module.exports = function (source) {
// Options must be specified, ignoring request if not.
Expand All @@ -26,17 +25,17 @@ module.exports = function (source) {
}
this.cacheable();

var filePath = this.resourcePath;
var context = this.rootContext;
var sourcePath = path.relative(context, filePath).split(path.sep).join("/");
const filePath = this.resourcePath;
const context = this.rootContext;
const sourcePath = path.relative(context, filePath).split(path.sep).join("/");

var ctx = Object.create(this.query);
const ctx = Object.create(this.query);
ctx.sourceMap = true;
ctx.sourceFile = sourcePath;

var callback = this.callback;
var sourceAndMap = preprocessor2.preprocessPDFJSCode(ctx, source);
var map = sourceAndMap.map.toJSON();
const callback = this.callback;
const sourceAndMap = preprocessor2.preprocessPDFJSCode(ctx, source);
const map = sourceAndMap.map.toJSON();
// escodegen does not embed source -- setting map's sourcesContent.
map.sourcesContent = [source];
callback(null, sourceAndMap.code, map);
Expand Down

0 comments on commit 96d2a2f

Please sign in to comment.