mirror of https://github.com/zulip/zulip.git
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:
parent
62dfee4930
commit
24d4ab327c
|
@ -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),
|
||||
};
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue