From 940c03a4a6d632cdd23e3fcf256a6d8595fefb46 Mon Sep 17 00:00:00 2001 From: mshanemc Date: Mon, 13 Nov 2023 16:36:56 -0600 Subject: [PATCH] fix: make eslint happy (enums, unknown> --- src/sfCommand.ts | 3 ++- src/util.ts | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/sfCommand.ts b/src/sfCommand.ts index bf2c5e10b..06d43124e 100644 --- a/src/sfCommand.ts +++ b/src/sfCommand.ts @@ -293,7 +293,8 @@ export abstract class SfCommand extends Command { this.ux.styledHeader(text); } - // eslint-disable-next-line class-methods-use-this + // leaving AnyJson and unknown to maintain the public API. + // eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-redundant-type-constituents public logJson(json: AnyJson | unknown): void { // If `--json` is enabled, then the ux instance on the class will disable output, which // means that the logJson method will not output anything. So, we need to create a new diff --git a/src/util.ts b/src/util.ts index baafcda55..4e5babe3e 100644 --- a/src/util.ts +++ b/src/util.ts @@ -35,11 +35,11 @@ export function toHelpSection( const body = vars .flatMap((v) => { if (typeof v === 'string') { - const orgConfig = ORG_CONFIG_ALLOWED_PROPERTIES.find(({ key }) => key === v); + const orgConfig = ORG_CONFIG_ALLOWED_PROPERTIES.find(({ key }) => key.toString() === v); if (orgConfig) { return { name: orgConfig.key, description: orgConfig.description }; } - const sfdxProperty = SFDX_ALLOWED_PROPERTIES.find(({ key }) => key === v); + const sfdxProperty = SFDX_ALLOWED_PROPERTIES.find(({ key }) => key.toString() === v); if (sfdxProperty) { return { name: sfdxProperty.key.valueOf(), description: sfdxProperty.description }; }