From 24d4ab327c741b720cb9a234a1df8d2f8763de2a Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Wed, 7 Oct 2020 02:59:16 -0700 Subject: [PATCH] eslint: Fix unicorn/prefer-negative-index. https://github.com/sindresorhus/eslint-plugin-unicorn/blob/master/docs/rules/prefer-negative-index.md Signed-off-by: Anders Kaseorg --- frontend_tests/zjsunit/i18n.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend_tests/zjsunit/i18n.js b/frontend_tests/zjsunit/i18n.js index b9e96958bd..d3c8d5333c 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), }; });