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 <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2020-10-07 02:59:16 -07:00 committed by Tim Abbott
parent 62dfee4930
commit 24d4ab327c
1 changed files with 2 additions and 2 deletions

View File

@ -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),
};
});