MMRIZE / MMM-CalendarExt3

MagicMirror calendar view module
MIT License
58 stars 22 forks source link

event Transformer does not play well with config:check #47

Closed ruralguru closed 1 year ago

ruralguru commented 1 year ago

Does not break functionality. when running config:check i get the following errors:

[ERROR] Your configuration file contains syntax errors :( [ERROR] Line 215 column 52: Parsing error: Unexpected token .

this corresponds to the second period before date below: e.start?.date

Two questions:

  1. Is there a Fix or is this the work around being to comment out the function?
  2. Can somebody direct me to some documentation that explains how the event is structured?
eouia commented 1 year ago
  1. ?.(optional chaining) is introduced recently (since ES2020 / Chrome 80 / NodeJS 14.0.0). But your validator esLint, which is used by config:check, might be probably old. After esLint@7.5 the validator could parse that syntax properly. (You may need to upgrade eslint npm install --save-dev eslint@^7.5)

  2. See this. https://github.com/MMRIZE/MMM-CalendarExt3#handling-events

To check original(before filtering/sorting/transforming or any other adjusting) event data from calendar module; https://github.com/MMRIZE/MMM-CalendarExt3/blob/9b97f69a2bccc1af8b9212a12bdec0ac6b21becf/MMM-CalendarExt3.js#L77-L78

Above line 78, insert this.

console.log(payload)

To check adjusted(after filtering/sorting/transforming...) event data of this module; https://github.com/MMRIZE/MMM-CalendarExt3/blob/9b97f69a2bccc1af8b9212a12bdec0ac6b21becf/MMM-CalendarExt3.js#L416-L417

Above line 417, insert this.

console.log(event)