Enable the ESLint no-var rule in the external/ folder

These changes were done automatically, by using the `gulp lint --fix` command.
This commit is contained in:
Jonas Jenwald 2021-03-14 11:06:48 +01:00
parent 67b866b9ed
commit 96d2a2f795
8 changed files with 13 additions and 48 deletions

View File

@ -10,7 +10,6 @@ external/quickjs/
src/shared/cffStandardStrings.js src/shared/cffStandardStrings.js
src/shared/fonts_utils.js src/shared/fonts_utils.js
test/tmp/ test/tmp/
test/features/
test/pdfs/ test/pdfs/
test/resources/ test/resources/
*~/ *~/

5
external/.eslintrc vendored
View File

@ -6,9 +6,4 @@
"env": { "env": {
"node": true, "node": true,
}, },
"rules": {
// ECMAScript 6
"no-var": "off",
},
} }

View File

@ -1,10 +0,0 @@
{
"extends": [
"../.eslintrc"
],
"rules": {
// ECMAScript 6
"no-var": "error",
},
}

View File

@ -1,10 +0,0 @@
{
"extends": [
"../.eslintrc"
],
"rules": {
// ECMAScript 6
"no-var": "error",
},
}

View File

@ -15,8 +15,8 @@
"use strict"; "use strict";
var pdfjs = require("./build/pdf.js"); const pdfjs = require("./build/pdf.js");
var PdfjsWorker = require("worker-loader?esModule=false&filename=[name].js!./build/pdf.worker.js"); const PdfjsWorker = require("worker-loader?esModule=false&filename=[name].js!./build/pdf.worker.js");
if (typeof window !== "undefined" && "Worker" in window) { if (typeof window !== "undefined" && "Worker" in window) {
pdfjs.GlobalWorkerOptions.workerPort = new PdfjsWorker(); pdfjs.GlobalWorkerOptions.workerPort = new PdfjsWorker();

View File

@ -1,10 +0,0 @@
{
"extends": [
"../.eslintrc"
],
"rules": {
// ECMAScript 6
"no-var": "error",
},
}

View File

@ -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-disable no-var */
var babel = require("plugin-babel"); var babel = require("plugin-babel");
var cacheExpiration = 60 /* min */ * 60 * 1000; var cacheExpiration = 60 /* min */ * 60 * 1000;

View File

@ -12,12 +12,11 @@
* 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-env node */
"use strict"; "use strict";
var preprocessor2 = require("../builder/preprocessor2.js"); const preprocessor2 = require("../builder/preprocessor2.js");
var path = require("path"); const path = require("path");
module.exports = function (source) { module.exports = function (source) {
// Options must be specified, ignoring request if not. // Options must be specified, ignoring request if not.
@ -26,17 +25,17 @@ module.exports = function (source) {
} }
this.cacheable(); this.cacheable();
var filePath = this.resourcePath; const filePath = this.resourcePath;
var context = this.rootContext; const context = this.rootContext;
var sourcePath = path.relative(context, filePath).split(path.sep).join("/"); 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.sourceMap = true;
ctx.sourceFile = sourcePath; ctx.sourceFile = sourcePath;
var callback = this.callback; const callback = this.callback;
var sourceAndMap = preprocessor2.preprocessPDFJSCode(ctx, source); const sourceAndMap = preprocessor2.preprocessPDFJSCode(ctx, source);
var map = sourceAndMap.map.toJSON(); const map = sourceAndMap.map.toJSON();
// escodegen does not embed source -- setting map's sourcesContent. // escodegen does not embed source -- setting map's sourcesContent.
map.sourcesContent = [source]; map.sourcesContent = [source];
callback(null, sourceAndMap.code, map); callback(null, sourceAndMap.code, map);