From 813a34dc6be0f364fceaa2400823e0d4bab98b8d Mon Sep 17 00:00:00 2001 From: ST-DDT Date: Mon, 6 Nov 2023 09:52:17 +0100 Subject: [PATCH] infra(unicorn): prefer-negative-index (#2512) --- .eslintrc.js | 1 - scripts/apidoc/signature.ts | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index b3d50623771..f2115380033 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -59,7 +59,6 @@ module.exports = defineConfig({ 'unicorn/prefer-code-point': 'off', 'unicorn/prefer-export-from': 'off', 'unicorn/prefer-module': 'off', - 'unicorn/prefer-negative-index': 'off', 'unicorn/prefer-string-slice': 'off', 'unicorn/prevent-abbreviations': 'off', 'unicorn/require-array-join-separator': 'off', diff --git a/scripts/apidoc/signature.ts b/scripts/apidoc/signature.ts index 2cca92b99d9..43026a78aa3 100644 --- a/scripts/apidoc/signature.ts +++ b/scripts/apidoc/signature.ts @@ -342,7 +342,7 @@ function extractDefaultFromComment(comment?: Comment): string | undefined { throw new Error(`Found description text after the default value:\n${text}`); } - summary.splice(summary.length - 2, 2); + summary.splice(-2, 2); const lastSummaryPart = summary[summary.length - 1]; lastSummaryPart.text = lastSummaryPart.text.replace(/[ \n]Defaults to $/, ''); return result[2];