From 9dccd6173ac26f385717f8c9e7c846d383f8ae7f Mon Sep 17 00:00:00 2001 From: Jakob Ackermann Date: Mon, 12 Jul 2021 12:40:29 +0200 Subject: [PATCH] Merge pull request #4305 from overleaf/jpa-fix-undef [misc] fix undefined references in all the places and enable lint rule GitOrigin-RevId: 473dbab577b34f60d6a3fe567e29e13cb5b1cb24 --- services/web/.eslintrc | 1 + services/web/app/src/Features/Chat/ChatController.js | 1 - services/web/app/src/Features/Compile/CompileController.js | 3 +-- .../web/app/src/Features/Downloads/ProjectZipStreamManager.js | 3 +-- .../web/app/src/Features/Subscription/TeamInvitesController.js | 3 +-- services/web/frontend/js/utils/webpack-public-path.js | 1 - .../test/frontend/ide/history/util/displayNameForUserTests.js | 1 - services/web/test/frontend/utils/EventEmitterTests.js | 1 - .../ide/editor/aceEditor/spell-check/SpellCheckManagerTests.js | 2 +- services/web/test/karma/ide/history/HistoryV2ManagerTests.js | 2 +- 10 files changed, 6 insertions(+), 12 deletions(-) diff --git a/services/web/.eslintrc b/services/web/.eslintrc index f46dc93855..e577f1067b 100644 --- a/services/web/.eslintrc +++ b/services/web/.eslintrc @@ -106,6 +106,7 @@ // Frontend specific rules "files": ["**/frontend/js/**/*.js", "**/frontend/stories/**/*.js", "**/*.stories.js", "**/test/frontend/**/*.js"], "globals": { + "__webpack_public_path__": true, "$": true, "angular": true, "ace": true, diff --git a/services/web/app/src/Features/Chat/ChatController.js b/services/web/app/src/Features/Chat/ChatController.js index 0bb489c75d..78243ae310 100644 --- a/services/web/app/src/Features/Chat/ChatController.js +++ b/services/web/app/src/Features/Chat/ChatController.js @@ -2,7 +2,6 @@ camelcase, node/handle-callback-err, max-len, - no-undef, no-unused-vars, */ // TODO: This file was created by bulk-decaffeinate. diff --git a/services/web/app/src/Features/Compile/CompileController.js b/services/web/app/src/Features/Compile/CompileController.js index 31f31dcef4..607077eefc 100644 --- a/services/web/app/src/Features/Compile/CompileController.js +++ b/services/web/app/src/Features/Compile/CompileController.js @@ -2,7 +2,6 @@ camelcase, node/handle-callback-err, max-len, - no-undef, no-unused-vars, */ // TODO: This file was created by bulk-decaffeinate. @@ -496,7 +495,7 @@ module.exports = CompileController = { let qs if (err != null) { OError.tag(err, 'error getting cookie jar for clsi request') - return callback(err) + return next(err) } // expand any url parameter passed in as {url:..., qs:...} if (typeof url === 'object') { diff --git a/services/web/app/src/Features/Downloads/ProjectZipStreamManager.js b/services/web/app/src/Features/Downloads/ProjectZipStreamManager.js index 162c5cb6a5..8412b46750 100644 --- a/services/web/app/src/Features/Downloads/ProjectZipStreamManager.js +++ b/services/web/app/src/Features/Downloads/ProjectZipStreamManager.js @@ -2,7 +2,6 @@ camelcase, node/handle-callback-err, max-len, - no-undef, */ // TODO: This file was created by bulk-decaffeinate. // Fix any style issues and re-enable lint. @@ -165,7 +164,7 @@ module.exports = ProjectZipStreamManager = { { err: error, project_id, file_id: file._id }, 'something went wrong adding file to zip archive' ) - return callback(err) + return callback(error) } if (path[0] === '/') { path = path.slice(1) diff --git a/services/web/app/src/Features/Subscription/TeamInvitesController.js b/services/web/app/src/Features/Subscription/TeamInvitesController.js index df6cf6ffd2..515674d08c 100644 --- a/services/web/app/src/Features/Subscription/TeamInvitesController.js +++ b/services/web/app/src/Features/Subscription/TeamInvitesController.js @@ -1,6 +1,5 @@ /* eslint-disable max-len, - no-undef, no-unused-vars, */ // TODO: This file was created by bulk-decaffeinate. @@ -120,7 +119,7 @@ module.exports = { ) }, - revokeInvite(req, res) { + revokeInvite(req, res, next) { const subscription = req.entity const email = EmailHelper.parseEmail(req.params.email) const teamManagerId = AuthenticationController.getLoggedInUserId(req) diff --git a/services/web/frontend/js/utils/webpack-public-path.js b/services/web/frontend/js/utils/webpack-public-path.js index 4675dfd3f8..674abbf59a 100644 --- a/services/web/frontend/js/utils/webpack-public-path.js +++ b/services/web/frontend/js/utils/webpack-public-path.js @@ -2,5 +2,4 @@ import getMeta from './meta' // Configure dynamically loaded assets (via webpack) to be downloaded from CDN // See: https://webpack.js.org/guides/public-path/#on-the-fly -// eslint-disable-next-line no-undef, camelcase __webpack_public_path__ = getMeta('ol-baseAssetPath') diff --git a/services/web/test/frontend/ide/history/util/displayNameForUserTests.js b/services/web/test/frontend/ide/history/util/displayNameForUserTests.js index 8b34ff4d96..8190c2281b 100644 --- a/services/web/test/frontend/ide/history/util/displayNameForUserTests.js +++ b/services/web/test/frontend/ide/history/util/displayNameForUserTests.js @@ -1,6 +1,5 @@ /* eslint-disable no-return-assign, - no-undef, */ // TODO: This file was created by bulk-decaffeinate. // Fix any style issues and re-enable lint. diff --git a/services/web/test/frontend/utils/EventEmitterTests.js b/services/web/test/frontend/utils/EventEmitterTests.js index a36f02e2d5..68ad71eed2 100644 --- a/services/web/test/frontend/utils/EventEmitterTests.js +++ b/services/web/test/frontend/utils/EventEmitterTests.js @@ -1,7 +1,6 @@ /* eslint-disable max-len, no-return-assign, - no-undef, */ // TODO: This file was created by bulk-decaffeinate. // Fix any style issues and re-enable lint. diff --git a/services/web/test/karma/ide/editor/aceEditor/spell-check/SpellCheckManagerTests.js b/services/web/test/karma/ide/editor/aceEditor/spell-check/SpellCheckManagerTests.js index a8e05225da..da8a0ffa88 100644 --- a/services/web/test/karma/ide/editor/aceEditor/spell-check/SpellCheckManagerTests.js +++ b/services/web/test/karma/ide/editor/aceEditor/spell-check/SpellCheckManagerTests.js @@ -1,7 +1,7 @@ /* eslint-disable max-len, - no-undef, */ +/* global inject, sinon */ // TODO: This file was created by bulk-decaffeinate. // Fix any style issues and re-enable lint. /* diff --git a/services/web/test/karma/ide/history/HistoryV2ManagerTests.js b/services/web/test/karma/ide/history/HistoryV2ManagerTests.js index fc79175b7a..84c5300604 100644 --- a/services/web/test/karma/ide/history/HistoryV2ManagerTests.js +++ b/services/web/test/karma/ide/history/HistoryV2ManagerTests.js @@ -1,8 +1,8 @@ /* eslint-disable max-len, no-return-assign, - no-undef, */ +/* global inject, sinon */ // TODO: This file was created by bulk-decaffeinate. // Fix any style issues and re-enable lint. /*