Skip to content

Commit

Permalink
fix(eslint-plugin): [no-magic-numbers] fix invalid schema merging (#4517
Browse files Browse the repository at this point in the history
)
  • Loading branch information
ddubrava committed Feb 7, 2022
1 parent 4209362 commit b95f796
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/eslint-plugin/src/rules/no-magic-numbers.ts
Expand Up @@ -9,7 +9,10 @@ type MessageIds = util.InferMessageIdsTypeFromRule<typeof baseRule>;

// 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: {
Expand Down

0 comments on commit b95f796

Please sign in to comment.