From c6b546b4b01250bea1c68470e4349c8e406a7c05 Mon Sep 17 00:00:00 2001 From: Daniil Dubrava Date: Mon, 7 Feb 2022 00:02:56 +0300 Subject: [PATCH] fix(eslint-plugin): replace schema spreading with the first element from schema --- packages/eslint-plugin/src/rules/no-magic-numbers.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/eslint-plugin/src/rules/no-magic-numbers.ts b/packages/eslint-plugin/src/rules/no-magic-numbers.ts index 2bab38f752d..7310123b85c 100644 --- a/packages/eslint-plugin/src/rules/no-magic-numbers.ts +++ b/packages/eslint-plugin/src/rules/no-magic-numbers.ts @@ -9,7 +9,10 @@ type MessageIds = util.InferMessageIdsTypeFromRule; // Extend base schema with additional property to ignore TS numeric literal types const schema = util.deepMerge( - { ...baseRule.meta.schema }, + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument -- https://github.com/microsoft/TypeScript/issues/17002 + Array.isArray(baseRule.meta.schema) + ? baseRule.meta.schema[0] + : baseRule.meta.schema, { properties: { ignoreNumericLiteralTypes: {