From 13a692eb3802c73db504ea2092b77b46ea1c9546 Mon Sep 17 00:00:00 2001 From: Josh Kneubuhl Date: Thu, 10 Nov 2022 06:16:34 -0500 Subject: [PATCH] Workaround for https://github.com/eslint/eslint/issues/15299 in the contract tslinter Signed-off-by: Josh Kneubuhl --- .../contracts/asset-transfer-typescript/.eslintrc.js | 2 ++ .../contracts/asset-transfer-typescript/src/assetTransfer.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/full-stack-asset-transfer-guide/contracts/asset-transfer-typescript/.eslintrc.js b/full-stack-asset-transfer-guide/contracts/asset-transfer-typescript/.eslintrc.js index 207a02ca..b6c93bfb 100644 --- a/full-stack-asset-transfer-guide/contracts/asset-transfer-typescript/.eslintrc.js +++ b/full-stack-asset-transfer-guide/contracts/asset-transfer-typescript/.eslintrc.js @@ -76,8 +76,10 @@ module.exports = { 4, { SwitchCase: 0, + ignoredNodes: ["PropertyDefinition"] }, ], + '@typescript-eslint/prefer-nullish-coalescing': ['error'], '@typescript-eslint/prefer-optional-chain': ['error'], '@typescript-eslint/prefer-reduce-type-parameter': ['error'], diff --git a/full-stack-asset-transfer-guide/contracts/asset-transfer-typescript/src/assetTransfer.ts b/full-stack-asset-transfer-guide/contracts/asset-transfer-typescript/src/assetTransfer.ts index 7c5285a9..0fd27cb7 100644 --- a/full-stack-asset-transfer-guide/contracts/asset-transfer-typescript/src/assetTransfer.ts +++ b/full-stack-asset-transfer-guide/contracts/asset-transfer-typescript/src/assetTransfer.ts @@ -195,7 +195,7 @@ function hasWritePermission(ctx: Context, asset: Asset): boolean { function clientIdentifier(ctx: Context, user?: string): OwnerIdentifier { return { org: ctx.clientIdentity.getMSPID(), - user: user || clientCommonName(ctx), + user: user ?? clientCommonName(ctx), }; }