Skip to content

Commit ae3efbe

Browse files
ddubravalonyele
authored andcommitted
fix(eslint-plugin): [no-magic-numbers] fix invalid schema merging (typescript-eslint#4517)
1 parent 7e1372e commit ae3efbe

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/eslint-plugin/src/rules/no-magic-numbers.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ type MessageIds = util.InferMessageIdsTypeFromRule<typeof baseRule>;
99

1010
// Extend base schema with additional property to ignore TS numeric literal types
1111
const schema = util.deepMerge(
12-
{ ...baseRule.meta.schema },
12+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument -- https://github.com/microsoft/TypeScript/issues/17002
13+
Array.isArray(baseRule.meta.schema)
14+
? baseRule.meta.schema[0]
15+
: baseRule.meta.schema,
1316
{
1417
properties: {
1518
ignoreNumericLiteralTypes: {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy