فهرست منبع

Merge pull request #4305 from overleaf/jpa-fix-undef

[misc] fix undefined references in all the places and enable lint rule

GitOrigin-RevId: 473dbab577b34f60d6a3fe567e29e13cb5b1cb24
Jakob Ackermann 5 سال پیش
والد
کامیت
9dccd6173a

+ 1 - 0
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,

+ 0 - 1
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.

+ 1 - 2
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') {

+ 1 - 2
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)

+ 1 - 2
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)

+ 0 - 1
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')

+ 0 - 1
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.

+ 0 - 1
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.

+ 1 - 1
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.
 /*

+ 1 - 1
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.
 /*