diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b39aba8cd..d50438ee7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -103,7 +103,7 @@ jobs: name: Check coding style runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actionsx/prettier@v3 + - uses: actions/checkout@v4 + - uses: Nerixyz/actionsx-prettier@v3-adj with: args: --check . diff --git a/package-lock.json b/package-lock.json index 2f6dfbcf8..5b5c2fe8f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -40,7 +40,7 @@ "eslint-plugin-workspaces": "^0.9.0", "husky": "^7.0.4", "mocha": "^11.1.0", - "prettier": "^3.0.0", + "prettier": "3.3.3", "pretty-quick": "^4.0.0", "sinon": "11.1.1", "source-map-support": "^0.5.20", @@ -12090,9 +12090,9 @@ } }, "node_modules/prettier": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.3.tgz", - "integrity": "sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", + "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", "dev": true, "license": "MIT", "bin": { diff --git a/package.json b/package.json index 4fc016059..c67534f87 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "eslint-plugin-workspaces": "^0.9.0", "husky": "^7.0.4", "mocha": "^11.1.0", - "prettier": "^3.0.0", + "prettier": "3.3.3", "pretty-quick": "^4.0.0", "sinon": "11.1.1", "source-map-support": "^0.5.20", diff --git a/packages/binding-modbus/src/modbus-client.ts b/packages/binding-modbus/src/modbus-client.ts index ff31d50bb..ad06f03a8 100644 --- a/packages/binding-modbus/src/modbus-client.ts +++ b/packages/binding-modbus/src/modbus-client.ts @@ -276,8 +276,8 @@ export default class ModbusClient implements ProtocolClient { mode === "r" ? ModbusFunction.readCoil : contentLength > 1 - ? ModbusFunction.writeMultipleCoils - : ModbusFunction.writeSingleCoil; + ? ModbusFunction.writeMultipleCoils + : ModbusFunction.writeSingleCoil; break; case "HoldingRegister": // the content length must be divided by 2 (holding registers are 16bit) @@ -285,8 +285,8 @@ export default class ModbusClient implements ProtocolClient { mode === "r" ? ModbusFunction.readHoldingRegisters : contentLength / 2 > 1 - ? ModbusFunction.writeMultipleHoldingRegisters - : ModbusFunction.writeSingleHoldingRegister; + ? ModbusFunction.writeMultipleHoldingRegisters + : ModbusFunction.writeSingleHoldingRegister; break; case "InputRegister": result["modv:function"] = ModbusFunction.readInputRegister; diff --git a/packages/binding-opcua/src/opcua-protocol-client.ts b/packages/binding-opcua/src/opcua-protocol-client.ts index c379f6479..6ecf42e0a 100644 --- a/packages/binding-opcua/src/opcua-protocol-client.ts +++ b/packages/binding-opcua/src/opcua-protocol-client.ts @@ -605,8 +605,8 @@ export class OPCUAProtocolClient implements ProtocolClient { valueRank === -1 ? VariantArrayType.Scalar : valueRank === 1 - ? VariantArrayType.Array - : VariantArrayType.Matrix; + ? VariantArrayType.Array + : VariantArrayType.Matrix; const n = (a: unknown) => Buffer.from(JSON.stringify(a)); const v = await this._contentToVariant(content2.type, n(bodyInput[name ?? "null"]), basicDataType); diff --git a/packages/core/src/codecs/octetstream-codec.ts b/packages/core/src/codecs/octetstream-codec.ts index aae832c51..5aec25931 100644 --- a/packages/core/src/codecs/octetstream-codec.ts +++ b/packages/core/src/codecs/octetstream-codec.ts @@ -183,8 +183,8 @@ export default class OctetstreamCodec implements ContentCodec { ? bytes.readInt16BE(0) : bytes.readUInt16BE(0) : signed - ? bytes.readInt16LE(0) - : bytes.readUInt16LE(0); + ? bytes.readInt16LE(0) + : bytes.readUInt16LE(0); case 32: return bigEndian @@ -192,8 +192,8 @@ export default class OctetstreamCodec implements ContentCodec { ? bytes.readInt32BE(0) : bytes.readUInt32BE(0) : signed - ? bytes.readInt32LE(0) - : bytes.readUInt32LE(0); + ? bytes.readInt32LE(0) + : bytes.readUInt32LE(0); default: { const result = bigEndian @@ -201,8 +201,8 @@ export default class OctetstreamCodec implements ContentCodec { ? bytes.readIntBE(0, dataLength / 8) : bytes.readUIntBE(0, dataLength / 8) : signed - ? bytes.readIntLE(0, dataLength / 8) - : bytes.readUIntLE(0, dataLength / 8); + ? bytes.readIntLE(0, dataLength / 8) + : bytes.readUIntLE(0, dataLength / 8); // warn about numbers being too big to be represented as safe integers if (!Number.isSafeInteger(result)) { warn("Result is not a safe integer"); @@ -460,8 +460,8 @@ export default class OctetstreamCodec implements ContentCodec { ? buf.writeInt16BE(value, 0) : buf.writeUInt16BE(value, 0) : signed - ? buf.writeInt16LE(value, 0) - : buf.writeUInt16LE(value, 0); + ? buf.writeInt16LE(value, 0) + : buf.writeUInt16LE(value, 0); break; case 4: @@ -470,8 +470,8 @@ export default class OctetstreamCodec implements ContentCodec { ? buf.writeInt32BE(value, 0) : buf.writeUInt32BE(value, 0) : signed - ? buf.writeInt32LE(value, 0) - : buf.writeUInt32LE(value, 0); + ? buf.writeInt32LE(value, 0) + : buf.writeUInt32LE(value, 0); break; default: diff --git a/packages/td-tools/src/td-tools.ts b/packages/td-tools/src/td-tools.ts index 9ffefa49e..a76ca469c 100644 --- a/packages/td-tools/src/td-tools.ts +++ b/packages/td-tools/src/td-tools.ts @@ -20,11 +20,12 @@ export * from "./thing-description"; export * from "./td-parser"; export * from "./td-helpers"; export * from "./thing-model-helpers"; -type DeepPartial = T extends Record - ? { - [P in keyof T]?: T[P] extends Array ? Array> : DeepPartial; - } - : T; +type DeepPartial = + T extends Record + ? { + [P in keyof T]?: T[P] extends Array ? Array> : DeepPartial; + } + : T; /** * @deprecated Will be removed in the future. Please use '@node-wot/core' package instead.