Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

eslint: Fix unicorn/prefer-negative-index.

Anders Kaseorg24d4ab327c74
diff --git a/frontend_tests/zjsunit/i18n.js b/frontend_tests/zjsunit/i18n.js
index b9e96958bd9..d3c8d5333c5 100644
--- a/frontend_tests/zjsunit/i18n.js
+++ b/frontend_tests/zjsunit/i18n.js
@@ -27,9 +27,9 @@ exports.t = function (str, context) {
prefix_length = 2;
}
return {
- keyword: key.slice(prefix_length, key.length - 2),
+ keyword: key.slice(prefix_length, -2),
prefix: key.slice(0, prefix_length),
- suffix: key.slice(key.length - 2, key.length),
+ suffix: key.slice(-2, key.length),
};
});