From 15e724aff33cba5c0006c21a14c77d4c419cac14 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sun, 19 Mar 2023 09:34:19 -0400 Subject: [PATCH] Always Object.defineProperty --- packages/typescript-estree/src/convert.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 4783e954564..91191d97100 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -3319,16 +3319,15 @@ export class Converter { aliasKey: AliasKey, valueKey: ValueKey, ): Properties & Record { - if (this.options.suppressDeprecatedPropertyWarnings) { - (node as any)[aliasKey] = node[valueKey]; - return node as Properties & Record; - } - let warned = false; Object.defineProperty(node, aliasKey, { configurable: true, get(): Properties[typeof valueKey] { + if (this.options.suppressDeprecatedPropertyWarnings) { + (node as any)[aliasKey] = node[valueKey]; + } + if (!warned) { // eslint-disable-next-line no-console console.warn(