diff --git a/services/chat/.eslintrc b/services/chat/.eslintrc index 34272adde6..68f10a66c3 100644 --- a/services/chat/.eslintrc +++ b/services/chat/.eslintrc @@ -22,7 +22,6 @@ "rules": { // TODO(das7pad): remove overrides after fixing all the violations manually (https://github.com/overleaf/issues/issues/3882#issuecomment-878999671) // START of temporary overrides - "no-empty": "off", "node/handle-callback-err": "off", "no-loss-of-precision": "off", "node/no-callback-literal": "off", diff --git a/services/clsi/.eslintrc b/services/clsi/.eslintrc index 34272adde6..68f10a66c3 100644 --- a/services/clsi/.eslintrc +++ b/services/clsi/.eslintrc @@ -22,7 +22,6 @@ "rules": { // TODO(das7pad): remove overrides after fixing all the violations manually (https://github.com/overleaf/issues/issues/3882#issuecomment-878999671) // START of temporary overrides - "no-empty": "off", "node/handle-callback-err": "off", "no-loss-of-precision": "off", "node/no-callback-literal": "off", diff --git a/services/contacts/.eslintrc b/services/contacts/.eslintrc index 34272adde6..68f10a66c3 100644 --- a/services/contacts/.eslintrc +++ b/services/contacts/.eslintrc @@ -22,7 +22,6 @@ "rules": { // TODO(das7pad): remove overrides after fixing all the violations manually (https://github.com/overleaf/issues/issues/3882#issuecomment-878999671) // START of temporary overrides - "no-empty": "off", "node/handle-callback-err": "off", "no-loss-of-precision": "off", "node/no-callback-literal": "off", diff --git a/services/docstore/.eslintrc b/services/docstore/.eslintrc index 34272adde6..68f10a66c3 100644 --- a/services/docstore/.eslintrc +++ b/services/docstore/.eslintrc @@ -22,7 +22,6 @@ "rules": { // TODO(das7pad): remove overrides after fixing all the violations manually (https://github.com/overleaf/issues/issues/3882#issuecomment-878999671) // START of temporary overrides - "no-empty": "off", "node/handle-callback-err": "off", "no-loss-of-precision": "off", "node/no-callback-literal": "off", diff --git a/services/document-updater/.eslintrc b/services/document-updater/.eslintrc index 34272adde6..68f10a66c3 100644 --- a/services/document-updater/.eslintrc +++ b/services/document-updater/.eslintrc @@ -22,7 +22,6 @@ "rules": { // TODO(das7pad): remove overrides after fixing all the violations manually (https://github.com/overleaf/issues/issues/3882#issuecomment-878999671) // START of temporary overrides - "no-empty": "off", "node/handle-callback-err": "off", "no-loss-of-precision": "off", "node/no-callback-literal": "off", diff --git a/services/document-updater/app/js/sharejs/text-composable.js b/services/document-updater/app/js/sharejs/text-composable.js index ebee536d9d..f5e9d91181 100644 --- a/services/document-updater/app/js/sharejs/text-composable.js +++ b/services/document-updater/app/js/sharejs/text-composable.js @@ -77,7 +77,9 @@ const checkOp = function (op) { exports._makeAppend = makeAppend = op => function (component) { if (component === 0 || component.i === '' || component.d === '') { - } else if (op.length === 0) { + return + } + if (op.length === 0) { return op.push(component) } else if ( typeof component === 'number' && diff --git a/services/document-updater/app/js/sharejs/text-tp2.js b/services/document-updater/app/js/sharejs/text-tp2.js index 7173c696b0..e2a40cf6bc 100644 --- a/services/document-updater/app/js/sharejs/text-tp2.js +++ b/services/document-updater/app/js/sharejs/text-tp2.js @@ -216,7 +216,9 @@ type._append = append = function (op, component) { component.i === 0 || component.d === 0 ) { - } else if (op.length === 0) { + return + } + if (op.length === 0) { return op.push(component) } else { const last = op[op.length - 1] diff --git a/services/document-updater/app/js/sharejs/types/text-composable.js b/services/document-updater/app/js/sharejs/types/text-composable.js index eccbde4439..199e695e8f 100644 --- a/services/document-updater/app/js/sharejs/types/text-composable.js +++ b/services/document-updater/app/js/sharejs/types/text-composable.js @@ -78,7 +78,9 @@ const checkOp = function (op) { moduleExport._makeAppend = makeAppend = op => function (component) { if (component === 0 || component.i === '' || component.d === '') { - } else if (op.length === 0) { + return + } + if (op.length === 0) { return op.push(component) } else if ( typeof component === 'number' && diff --git a/services/document-updater/app/js/sharejs/types/text-tp2.js b/services/document-updater/app/js/sharejs/types/text-tp2.js index 7173c696b0..e2a40cf6bc 100644 --- a/services/document-updater/app/js/sharejs/types/text-tp2.js +++ b/services/document-updater/app/js/sharejs/types/text-tp2.js @@ -216,7 +216,9 @@ type._append = append = function (op, component) { component.i === 0 || component.d === 0 ) { - } else if (op.length === 0) { + return + } + if (op.length === 0) { return op.push(component) } else { const last = op[op.length - 1] diff --git a/services/filestore/.eslintrc b/services/filestore/.eslintrc index 34272adde6..68f10a66c3 100644 --- a/services/filestore/.eslintrc +++ b/services/filestore/.eslintrc @@ -22,7 +22,6 @@ "rules": { // TODO(das7pad): remove overrides after fixing all the violations manually (https://github.com/overleaf/issues/issues/3882#issuecomment-878999671) // START of temporary overrides - "no-empty": "off", "node/handle-callback-err": "off", "no-loss-of-precision": "off", "node/no-callback-literal": "off", diff --git a/services/notifications/.eslintrc b/services/notifications/.eslintrc index 34272adde6..68f10a66c3 100644 --- a/services/notifications/.eslintrc +++ b/services/notifications/.eslintrc @@ -22,7 +22,6 @@ "rules": { // TODO(das7pad): remove overrides after fixing all the violations manually (https://github.com/overleaf/issues/issues/3882#issuecomment-878999671) // START of temporary overrides - "no-empty": "off", "node/handle-callback-err": "off", "no-loss-of-precision": "off", "node/no-callback-literal": "off", diff --git a/services/real-time/.eslintrc b/services/real-time/.eslintrc index 34272adde6..68f10a66c3 100644 --- a/services/real-time/.eslintrc +++ b/services/real-time/.eslintrc @@ -22,7 +22,6 @@ "rules": { // TODO(das7pad): remove overrides after fixing all the violations manually (https://github.com/overleaf/issues/issues/3882#issuecomment-878999671) // START of temporary overrides - "no-empty": "off", "node/handle-callback-err": "off", "no-loss-of-precision": "off", "node/no-callback-literal": "off", diff --git a/services/spelling/.eslintrc b/services/spelling/.eslintrc index 34272adde6..68f10a66c3 100644 --- a/services/spelling/.eslintrc +++ b/services/spelling/.eslintrc @@ -22,7 +22,6 @@ "rules": { // TODO(das7pad): remove overrides after fixing all the violations manually (https://github.com/overleaf/issues/issues/3882#issuecomment-878999671) // START of temporary overrides - "no-empty": "off", "node/handle-callback-err": "off", "no-loss-of-precision": "off", "node/no-callback-literal": "off", diff --git a/services/track-changes/.eslintrc b/services/track-changes/.eslintrc index 34272adde6..68f10a66c3 100644 --- a/services/track-changes/.eslintrc +++ b/services/track-changes/.eslintrc @@ -22,7 +22,6 @@ "rules": { // TODO(das7pad): remove overrides after fixing all the violations manually (https://github.com/overleaf/issues/issues/3882#issuecomment-878999671) // START of temporary overrides - "no-empty": "off", "node/handle-callback-err": "off", "no-loss-of-precision": "off", "node/no-callback-literal": "off",