From 44c9e449dd202216bc1ff758372ac32928c7fba4 Mon Sep 17 00:00:00 2001 From: Jakub Dzikowski Date: Tue, 15 Oct 2024 20:09:23 +0200 Subject: [PATCH] Fix linting Signed-off-by: Jakub Dzikowski --- e2e/fabloCommands.test.ts | 3 ++- src/extend-config/extendGlobal.ts | 5 ++--- src/types/FabloConfigExtended.ts | 2 -- src/validate/index.ts | 6 +++--- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/e2e/fabloCommands.test.ts b/e2e/fabloCommands.test.ts index e98c375a..65a893d7 100644 --- a/e2e/fabloCommands.test.ts +++ b/e2e/fabloCommands.test.ts @@ -111,10 +111,11 @@ describe("validate", () => { // Given const sourceConfigPath = require.resolve("../samples/fablo-config-hlf2-1org-1chaincode-raft-explorer.json"); const samplesDir = sourceConfigPath.replace("/fablo-config-hlf2-1org-1chaincode-raft-explorer.json", ""); + // eslint-disable-next-line @typescript-eslint/no-var-requires const sourceConfig = require(sourceConfigPath) as FabloConfigJson; // old schema - sourceConfig.$schema = "https://github.com/hyperledger-labs/fablo/releases/download/1.2.0/schema.json" + sourceConfig.$schema = "https://github.com/hyperledger-labs/fablo/releases/download/1.2.0/schema.json"; // invalid org sourceConfig.orgs[0].organization.mspName = "some-org1"; diff --git a/src/extend-config/extendGlobal.ts b/src/extend-config/extendGlobal.ts index 86fe31ff..9cd63d37 100644 --- a/src/extend-config/extendGlobal.ts +++ b/src/extend-config/extendGlobal.ts @@ -5,14 +5,13 @@ import { GlobalJson } from "../types/FabloConfigJson"; import defaults from "./defaults"; const getNetworkCapabilities = (fabricVersion: string): Capabilities => { - if (version(fabricVersion).isGreaterOrEqual("2.5.0") && !version(fabricVersion).isGreaterOrEqual("3.0.0")) return { channel: "V2_0", orderer: "V2_0", application: "V2_5", isV2: true, isV3: false }; if (version(fabricVersion).isGreaterOrEqual("3.0.0")) - return { channel: "V3_0", orderer: "V2_0", application: "V2_5", isV2: false, isV3: true}; + return { channel: "V3_0", orderer: "V2_0", application: "V2_5", isV2: false, isV3: true }; - return { channel: "V2_0", orderer: "V2_0", application: "V2_0", isV2: true , isV3: false}; + return { channel: "V2_0", orderer: "V2_0", application: "V2_0", isV2: true, isV3: false }; }; const getVersions = (fabricVersion: string): FabricVersions => { diff --git a/src/types/FabloConfigExtended.ts b/src/types/FabloConfigExtended.ts index f6b75fd2..a4cc35f1 100644 --- a/src/types/FabloConfigExtended.ts +++ b/src/types/FabloConfigExtended.ts @@ -16,7 +16,6 @@ interface CapabilitiesV2 { isV3: false; } - interface CapabilitiesV_2_5 { application: "V2_5"; channel: "V2_0"; @@ -33,7 +32,6 @@ interface CapabilitiesV3_0 { isV3: true; } - export type Capabilities = CapabilitiesV2 | CapabilitiesV_2_5 | CapabilitiesV3_0; export interface Global extends FabricVersions { diff --git a/src/validate/index.ts b/src/validate/index.ts index 98c80bca..3d8a3b88 100644 --- a/src/validate/index.ts +++ b/src/validate/index.ts @@ -466,12 +466,12 @@ class ValidateGenerator extends Generator { _validateDevMode(global: GlobalJson): void { if (global.peerDevMode && global.tls) { - const message = `TLS needs to be disabled when running peers in dev mode`; - this.emit(validationErrorType.ERROR, { category: validationCategories.GENERAL, message }); + const message = `TLS needs to be disabled when running peers in dev mode`; + this.emit(validationErrorType.ERROR, { category: validationCategories.GENERAL, message }); } } - _verifyFabricVersion(global:GlobalJson){ + _verifyFabricVersion(global: GlobalJson) { if (!version(global.fabricVersion).isGreaterOrEqual("2.0.0")) { const message = `Fablo supports Fabric in version 2.0.0 and higher`; this.emit(validationErrorType.ERROR, { category: validationCategories.GENERAL, message });