-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Enable the ESLint no-var
rule in gulpfile.js
#13090
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable the ESLint no-var
rule in gulpfile.js
#13090
Conversation
Given that `let`/`const` is already used here and there in this file, converting the rest of the `var` occurrences shouldn't be a problem. Note that the majority of these changes were done automatically, by using the `gulp lint --fix` command, and the manual changes were limited to the following diff: ```diff diff --git a/gulpfile.js b/gulpfile.js index e2360c8ec..905420c 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -676,8 +676,8 @@ gulp.task("default_preferences-pre", function () { ], }).code; } - var babel = require("@babel/core"); - var ctx = { + const babel = require("@babel/core"); + const ctx = { rootPath: __dirname, saveComments: false, defines: builder.merge(DEFINES, { @@ -690,7 +690,7 @@ gulp.task("default_preferences-pre", function () { "pdfjs-lib": "../pdf", }, }; - var preprocessor2 = require("./external/builder/preprocessor2.js"); + const preprocessor2 = require("./external/builder/preprocessor2.js"); return merge([ gulp.src(["web/{app_options,viewer_compatibility}.js"], { base: ".", @@ -1418,14 +1418,14 @@ function buildLib(defines, dir) { }); return licenseHeaderLibre + content; } - var babel = require("@babel/core"); + const babel = require("@babel/core"); const versionInfo = getVersionJSON(); - var bundleDefines = builder.merge(defines, { + const bundleDefines = builder.merge(defines, { BUNDLE_VERSION: versionInfo.version, BUNDLE_BUILD: versionInfo.commit, TESTING: process.env.TESTING === "true", }); - var ctx = { + const ctx = { rootPath: __dirname, saveComments: false, defines: bundleDefines, @@ -1433,10 +1433,10 @@ function buildLib(defines, dir) { "pdfjs-lib": "../pdf", }, }; - var licenseHeaderLibre = fs + const licenseHeaderLibre = fs .readFileSync("./src/license_header_libre.js") .toString(); - var preprocessor2 = require("./external/builder/preprocessor2.js"); + const preprocessor2 = require("./external/builder/preprocessor2.js"); return merge([ gulp.src( [ ```
…it/` folder (PR 12528 follow-up) These lines are no longer needed, since the ESLint `no-var` rule has been enabled in the entire folder.
/botio unittest |
From: Bot.io (Linux m4)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/31e418e9d0abb1e/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://3.101.106.178:8877/60c996e4b63d483/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/31e418e9d0abb1e/output.txt Total script time: 3.55 mins
|
From: Bot.io (Windows)SuccessFull output at http://3.101.106.178:8877/60c996e4b63d483/output.txt Total script time: 5.24 mins
|
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/64d22eecc5a748c/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/64d22eecc5a748c/output.txt Total script time: 4.07 mins Published |
Looks good; thanks! |
Please refer to the individual commit messages for additional details.