Skip to content

Commit

Permalink
different prettier settings (#19)
Browse files Browse the repository at this point in the history
Co-authored-by: Max Gruenfelder <[email protected]>
  • Loading branch information
soccermax and Max Gruenfelder authored Jul 26, 2023
1 parent a5b09a9 commit ff48c0d
Show file tree
Hide file tree
Showing 26 changed files with 458 additions and 1,044 deletions.
7 changes: 1 addition & 6 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,7 @@ module.exports = {
DROP: false,
},
plugins: ["jest", "node"],
extends: [
"eslint:recommended",
"plugin:jest/recommended",
"plugin:@sap/cds/recommended",
"prettier",
],
extends: ["eslint:recommended", "plugin:jest/recommended", "plugin:@sap/cds/recommended", "prettier"],
rules: {
"no-unused-vars": [
"error",
Expand Down
3 changes: 3 additions & 0 deletions .prettierrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
printWidth: 120
trailingComma: es5
10 changes: 2 additions & 8 deletions docs/implement-event/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,7 @@ for each queueEntry. Each queueEntry may have a different status.
```js
"use strict";

const {
EventQueueBaseClass,
EventProcessingStatus,
} = require("@cap-js-community/event-queue");
const { EventQueueBaseClass, EventProcessingStatus } = require("@cap-js-community/event-queue");

class EventQueueMinimalistic extends EventQueueBaseClass {
constructor(context, eventType, eventSubType, config) {
Expand Down Expand Up @@ -96,10 +93,7 @@ class EventQueueAdvanced extends EventQueueBaseClass {
}

async checkEventAndGeneratePayload(queueEntry) {
const eventStillValid = await checkEventIsStillValid(
this.tx,
queueEntry.payload
);
const eventStillValid = await checkEventIsStillValid(this.tx, queueEntry.payload);
if (!eventStillValid) {
this.logger.info("Event not valid anymore, skipping processing", {
eventType: this.__eventType,
Expand Down
15 changes: 5 additions & 10 deletions src/EventQueueError.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@ const ERROR_CODES = {

const ERROR_CODES_META = {
[ERROR_CODES.WRONG_TX_USAGE]: {
message:
"Usage of this.tx|this.context is not allowed if parallel event processing is enabled",
message: "Usage of this.tx|this.context is not allowed if parallel event processing is enabled",
},
[ERROR_CODES.UNKNOWN_EVENT_TYPE]: {
message:
"The event type and subType configuration is not configured! Maintain the combination in the config file.",
message: "The event type and subType configuration is not configured! Maintain the combination in the config file.",
},
[ERROR_CODES.NOT_INITIALIZED]: {
message:
Expand All @@ -33,16 +31,13 @@ const ERROR_CODES_META = {
message: "disabled reconnect, because we are not running on cloud foundry",
},
[ERROR_CODES.MISSING_TABLE_DEFINITION]: {
message:
"Could not find table in csn. Make sure the provided table name is correct and the table is known by CDS.",
message: "Could not find table in csn. Make sure the provided table name is correct and the table is known by CDS.",
},
[ERROR_CODES.MISSING_ELEMENT_IN_TABLE]: {
message:
"The provided table doesn't match the required structure. At least the following element is missing.",
message: "The provided table doesn't match the required structure. At least the following element is missing.",
},
[ERROR_CODES.TYPE_MISMATCH_TABLE]: {
message:
"At least one field in the provided table doesn't have the expected data type.",
message: "At least one field in the provided table doesn't have the expected data type.",
},
};

Expand Down
Loading

0 comments on commit ff48c0d

Please sign in to comment.