From 08d29c30836c5bca6626f9919477e63da3388ece Mon Sep 17 00:00:00 2001 From: Veeck Date: Thu, 11 Sep 2025 13:10:53 +0200 Subject: [PATCH] Add Prettier plugin for Nunjuck templates (#3887) --- CHANGELOG.md | 5 +- modules/default/alert/templates/alert.njk | 28 +-- .../default/alert/templates/notification.njk | 6 +- modules/default/newsfeed/fullarticle.njk | 2 +- modules/default/newsfeed/newsfeed.njk | 152 +++++++-------- modules/default/newsfeed/oldconfig.njk | 4 +- .../updatenotification/updatenotification.njk | 78 ++++---- modules/default/weather/current.njk | 174 +++++++++--------- modules/default/weather/forecast.njk | 88 +++++---- modules/default/weather/hourly.njk | 92 +++++---- package-lock.json | 11 ++ package.json | 1 + prettier.config.mjs | 7 + 13 files changed, 325 insertions(+), 323 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 872ad48d..16d0a462 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ Thanks to: @dathbe. ### Added - Added configuration option for `User-Agent`, used by calendar & news module (#3255) +- [linter] Added prettier plugin for nunjuck templates (#3887) ### Changed @@ -308,7 +309,7 @@ For more info, please read the following post: [A New Chapter for MagicMirror: T ### Added - Output of system information to the console for troubleshooting (#3328 and #3337), ignore errors under aarch64 (#3349) -- [core] Add `eslint-plugin-package-json` to lint the `package.json` files (#3368) +- [linter] Add `eslint-plugin-package-json` to lint the `package.json` files (#3368) - [weather] `showHumidity` config is now a string describing where to show this element. Supported values: "wind", "temp", "feelslike", "below", "none". (#3330) - electron-rebuild test suite for electron and 3rd party modules compatibility (#3392) - Create MM² icon and attach it to electron process (#3407) @@ -470,7 +471,7 @@ Special thanks to @khassel, @rejas and @sdetweil for taking over most (if not al - Added UV Index to hourly and current Weather, with support for Openmeteo - Added tests for serveronly - Set Timezone `Europe/Berlin` in unit tests (needed for new formatTime tests) -- Added no-param-reassign eslint rule and fix warnings +- [linter] Added no-param-reassign eslint rule and fix warnings - [updatenotification] Added `sendUpdatesNotifications` feature. Broadcast update with `UPDATES` notification to other modules - [updatenotification] Allow force scanning with `SCAN_UPDATES` notification from other modules - Added per-calendar fetchInterval diff --git a/modules/default/alert/templates/alert.njk b/modules/default/alert/templates/alert.njk index b7db3a4d..727c9185 100644 --- a/modules/default/alert/templates/alert.njk +++ b/modules/default/alert/templates/alert.njk @@ -1,20 +1,20 @@ {% if imageUrl or imageFA %} - {% set imageHeight = imageHeight if imageHeight else "80px" %} - {% if imageUrl %} - - {% else %} - - {% endif %} -
+ {% set imageHeight = imageHeight if imageHeight else "80px" %} + {% if imageUrl %} + + {% else %} + + {% endif %} +
{% endif %} {% if title %} - {{ title if titleType == 'text' else title | safe }} + {{ title if titleType == 'text' else title | safe }} {% endif %} {% if message %} - {% if title %}
{% endif %} - {{ message if messageType == 'text' else message | safe }} + {% if title %}
{% endif %} + {{ message if messageType == 'text' else message | safe }} {% endif %} diff --git a/modules/default/alert/templates/notification.njk b/modules/default/alert/templates/notification.njk index 0de6908b..8e4f3341 100644 --- a/modules/default/alert/templates/notification.njk +++ b/modules/default/alert/templates/notification.njk @@ -1,7 +1,7 @@ {% if title %} - {{ title if titleType == 'text' else title | safe }} + {{ title if titleType == 'text' else title | safe }} {% endif %} {% if message %} - {% if title %}
{% endif %} - {{ message if messageType == 'text' else message | safe }} + {% if title %}
{% endif %} + {{ message if messageType == 'text' else message | safe }} {% endif %} diff --git a/modules/default/newsfeed/fullarticle.njk b/modules/default/newsfeed/fullarticle.njk index 0be4b042..fbd6e437 100644 --- a/modules/default/newsfeed/fullarticle.njk +++ b/modules/default/newsfeed/fullarticle.njk @@ -1,3 +1,3 @@
- +
diff --git a/modules/default/newsfeed/newsfeed.njk b/modules/default/newsfeed/newsfeed.njk index 5bdfe2cd..9a91cb94 100644 --- a/modules/default/newsfeed/newsfeed.njk +++ b/modules/default/newsfeed/newsfeed.njk @@ -1,89 +1,89 @@ {% macro escapeText(text, dangerouslyDisableAutoEscaping=false) %} - {% if dangerouslyDisableAutoEscaping -%} - {{ text | safe }} - {%- else -%} - {{ text }} - {%- endif %} + {% if dangerouslyDisableAutoEscaping -%} + {{ text | safe }} + {%- else -%} + {{ text }} + {%- endif %} {% endmacro %} {% macro escapeTitle(title, url, dangerouslyDisableAutoEscaping=false, showTitleAsUrl=false) %} - {% if dangerouslyDisableAutoEscaping %} - {% if showTitleAsUrl %} - {{ title | safe }} - {% else %} - {{ title | safe }} - {% endif %} + target="_blank" + >{{ title | safe }} {% else %} - {% if showTitleAsUrl %} - {{ title }} - {% else %} - {{ title }} - {% endif %} + {{ title | safe }} {% endif %} + {% else %} + {% if showTitleAsUrl %} + {{ title }} + {% else %} + {{ title }} + {% endif %} + {% endif %} {% endmacro %} {% if loaded %} - {% if config.showAsList %} - - {% else %} -
- {% if (config.showSourceTitle and sourceTitle) or config.showPublishDate %} -
- {% if sourceTitle and config.showSourceTitle %} - {{ escapeText(sourceTitle, config.dangerouslyDisableAutoEscaping) }}{% if config.showPublishDate %}, {% else %}:{% endif %} - {% endif %} - {% if config.showPublishDate %}{{ publishDate }}:{% endif %} -
- {% endif %} -
- {{ escapeTitle(title, url, config.dangerouslyDisableAutoEscaping, config.showTitleAsUrl) }} + {% if config.showAsList %} +
    + {% for item in items %} +
  • + {% if (config.showSourceTitle and item.sourceTitle) or config.showPublishDate %} +
    + {% if item.sourceTitle and config.showSourceTitle %} + {{ item.sourceTitle }}{% if config.showPublishDate %},{% else %}:{% endif %} + {% endif %} + {% if config.showPublishDate %}{{ item.publishDate }}:{% endif %}
    - {% if config.showDescription %} -
    - {% if config.truncDescription %} - {{ escapeText(description | truncate(config.lengthDescription) , config.dangerouslyDisableAutoEscaping) }} - {% else %} - {{ escapeText(description, config.dangerouslyDisableAutoEscaping) }} - {% endif %} -
    - {% endif %} + {% endif %} +
    {{ escapeTitle(item.title, item.url, config.dangerouslyDisableAutoEscaping, config.showTitleAsUrl) }}
    + {% if config.showDescription %} +
    + {% if config.truncDescription %} + {{ escapeText(item.description | truncate(config.lengthDescription) , config.dangerouslyDisableAutoEscaping) }} + {% else %} + {{ escapeText(item.description, config.dangerouslyDisableAutoEscaping) }} + {% endif %} +
    + {% endif %} +
  • + {% endfor %} +
+ {% else %} +
+ {% if (config.showSourceTitle and sourceTitle) or config.showPublishDate %} +
+ {% if sourceTitle and config.showSourceTitle %} + {{ escapeText(sourceTitle, config.dangerouslyDisableAutoEscaping) }}{% if config.showPublishDate %},{% else %}:{% endif %} + {% endif %} + {% if config.showPublishDate %}{{ publishDate }}:{% endif %}
- {% endif %} -{% elseif empty %} -
{{ "NEWSFEED_NO_ITEMS" | translate | safe }}
-{% elseif error %} -
- {{ "MODULE_CONFIG_ERROR" | translate({MODULE_NAME: "Newsfeed", ERROR: error}) | safe }} + {% endif %} +
{{ escapeTitle(title, url, config.dangerouslyDisableAutoEscaping, config.showTitleAsUrl) }}
+ {% if config.showDescription %} +
+ {% if config.truncDescription %} + {{ escapeText(description | truncate(config.lengthDescription) , config.dangerouslyDisableAutoEscaping) }} + {% else %} + {{ escapeText(description, config.dangerouslyDisableAutoEscaping) }} + {% endif %} +
+ {% endif %}
+ {% endif %} + {% elseif empty %} +
{{ "NEWSFEED_NO_ITEMS" | translate | safe }}
+ {% elseif error %} +
{{ "MODULE_CONFIG_ERROR" | translate({MODULE_NAME: "Newsfeed", ERROR: error}) | safe }}
{% else %} -
{{ "LOADING" | translate | safe }}
+
{{ "LOADING" | translate | safe }}
{% endif %} diff --git a/modules/default/newsfeed/oldconfig.njk b/modules/default/newsfeed/oldconfig.njk index 0e3b9b5d..d8317ca2 100644 --- a/modules/default/newsfeed/oldconfig.njk +++ b/modules/default/newsfeed/oldconfig.njk @@ -1,3 +1 @@ -
- {{ "MODULE_CONFIG_CHANGED" | translate({MODULE_NAME: "Newsfeed"}) | safe }} -
+
{{ "MODULE_CONFIG_CHANGED" | translate({MODULE_NAME: "Newsfeed"}) | safe }}
diff --git a/modules/default/updatenotification/updatenotification.njk b/modules/default/updatenotification/updatenotification.njk index fbc43f22..b08346f3 100644 --- a/modules/default/updatenotification/updatenotification.njk +++ b/modules/default/updatenotification/updatenotification.njk @@ -1,41 +1,41 @@ {% if not suspended %} - {% if needRestart %} -
- - - {% set restartTextLabel = "UPDATE_NOTIFICATION_NEED-RESTART" %} - {{ restartTextLabel | translate() | safe }} - -
- {% endif %} - {% for name, status in moduleList %} -
- - - {% set mainTextLabel = "UPDATE_NOTIFICATION" if name === "MagicMirror" else "UPDATE_NOTIFICATION_MODULE" %} - {{ mainTextLabel | translate({MODULE_NAME: name}) }} - -
-
- {% set subTextLabel = "UPDATE_INFO_SINGLE" if status.behind === 1 else "UPDATE_INFO_MULTIPLE" %} - {{ subTextLabel | translate({COMMIT_COUNT: status.behind, BRANCH_NAME: status.current}) | diffLink(status) | safe }} -
- {% endfor %} - {% for name, status in updatesList %} -
- {% if status.done %} - - - {% set updateTextLabel = "UPDATE_NOTIFICATION_DONE" %} - {{ updateTextLabel | translate({MODULE_NAME: name}) | safe }} - - {% else %} - - - {% set updateTextLabel = "UPDATE_NOTIFICATION_ERROR" %} - {{ updateTextLabel | translate({MODULE_NAME: name}) | safe }} - - {% endif %} -
- {% endfor %} + {% if needRestart %} +
+ + + {% set restartTextLabel = "UPDATE_NOTIFICATION_NEED-RESTART" %} + {{ restartTextLabel | translate() | safe }} + +
+ {% endif %} + {% for name, status in moduleList %} +
+ + + {% set mainTextLabel = "UPDATE_NOTIFICATION" if name === "MagicMirror" else "UPDATE_NOTIFICATION_MODULE" %} + {{ mainTextLabel | translate({MODULE_NAME: name}) }} + +
+
+ {% set subTextLabel = "UPDATE_INFO_SINGLE" if status.behind === 1 else "UPDATE_INFO_MULTIPLE" %} + {{ subTextLabel | translate({COMMIT_COUNT: status.behind, BRANCH_NAME: status.current}) | diffLink(status) | safe }} +
+ {% endfor %} + {% for name, status in updatesList %} +
+ {% if status.done %} + + + {% set updateTextLabel = "UPDATE_NOTIFICATION_DONE" %} + {{ updateTextLabel | translate({MODULE_NAME: name}) | safe }} + + {% else %} + + + {% set updateTextLabel = "UPDATE_NOTIFICATION_ERROR" %} + {{ updateTextLabel | translate({MODULE_NAME: name}) | safe }} + + {% endif %} +
+ {% endfor %} {% endif %} diff --git a/modules/default/weather/current.njk b/modules/default/weather/current.njk index d1984895..0de73f8e 100644 --- a/modules/default/weather/current.njk +++ b/modules/default/weather/current.njk @@ -1,101 +1,95 @@ {% macro humidity() %} - {% if current.humidity %} - {{ current.humidity | decimalSymbol }}  - {% endif %} + {% if current.humidity %} + {{ current.humidity | decimalSymbol }}  + {% endif %} {% endmacro %} {% if current %} - {% if not config.onlyTemp %} -
- - - {{ current.windSpeed | unit("wind") | round }} - {% if config.showWindDirection %} - - {% if config.showWindDirectionAsArrow %} - - {% else %} - {{ current.cardinalWindDirection() | translate }} - {% endif %} -   - - {% endif %} - - {% if config.showHumidity === "wind" %} - {{ humidity() }} + {% if not config.onlyTemp %} +
+ + + {{ current.windSpeed | unit("wind") | round }} + {% if config.showWindDirection %} + + {% if config.showWindDirectionAsArrow %} + + {% else %} + {{ current.cardinalWindDirection() | translate }} {% endif %} - {% if config.showSun %} - - - {% if current.nextSunAction() === "sunset" %} - {{ current.sunset | formatTime }} - {% else %} - {{ current.sunrise | formatTime }} - {% endif %} - - {% endif %} - {% if config.showUVIndex %} - -
- {{ current.uv_index }} - - {% endif %} -
- {% endif %} -
- {% if config.showIndoorTemperature and indoor.temperature or config.showIndoorHumidity and indoor.humidity %} - - - {% if config.showIndoorTemperature and indoor.temperature %} - - - {{ indoor.temperature | roundValue | unit("temperature") | decimalSymbol }} - - - {% endif %} - {% if config.showIndoorHumidity and indoor.humidity %} - - - {{ indoor.humidity | roundValue | unit("humidity") | decimalSymbol }} - - - {% endif %} - - {% endif %} - - {{ current.temperature | roundValue | unit("temperature") | decimalSymbol }} - {% if config.showHumidity === "temp" %} - {{ humidity() }} +   + {% endif %} + + {% if config.showHumidity === "wind" %} + {{ humidity() }} + {% endif %} + {% if config.showSun %} + + + {% if current.nextSunAction() === "sunset" %} + {{ current.sunset | formatTime }} + {% else %} + {{ current.sunrise | formatTime }} + {% endif %} + + {% endif %} + {% if config.showUVIndex %} + +
+ {{ current.uv_index }} + + {% endif %}
- {% if (config.showFeelsLike or config.showPrecipitationAmount or config.showPrecipitationProbability) and not config.onlyTemp %} -
- {% if config.showFeelsLike %} - - {% if config.showHumidity === "feelslike" %} - {{ humidity() }} - {% endif %} - {{ "FEELS" | translate({DEGREE: current.feelsLike() | roundValue | unit("temperature") | decimalSymbol }) }} - -
- {% endif %} - {% if config.showPrecipitationAmount and current.precipitationAmount %} - - {{ "PRECIP_AMOUNT" | translate }} {{ current.precipitationAmount | unit("precip", current.precipitationUnits) }} - -
- {% endif %} - {% if config.showPrecipitationProbability and current.precipitationProbability %} - - {{ "PRECIP_POP" | translate }} {{ current.precipitationProbability }}% - - {% endif %} -
+ {% endif %} +
+ {% if config.showIndoorTemperature and indoor.temperature or config.showIndoorHumidity and indoor.humidity %} + + + {% if config.showIndoorTemperature and indoor.temperature %} + + {{ indoor.temperature | roundValue | unit("temperature") | decimalSymbol }} + + {% endif %} + {% if config.showIndoorHumidity and indoor.humidity %} + + {{ indoor.humidity | roundValue | unit("humidity") | decimalSymbol }} + + {% endif %} + {% endif %} - {% if config.showHumidity === "below" %} - {{ humidity() }} + + {{ current.temperature | roundValue | unit("temperature") | decimalSymbol }} + {% if config.showHumidity === "temp" %} + {{ humidity() }} {% endif %} +
+ {% if (config.showFeelsLike or config.showPrecipitationAmount or config.showPrecipitationProbability) and not config.onlyTemp %} +
+ {% if config.showFeelsLike %} + + {% if config.showHumidity === "feelslike" %} + {{ humidity() }} + {% endif %} + {{ "FEELS" | translate({DEGREE: current.feelsLike() | roundValue | unit("temperature") | decimalSymbol }) }} + +
+ {% endif %} + {% if config.showPrecipitationAmount and current.precipitationAmount %} + {{ "PRECIP_AMOUNT" | translate }} {{ current.precipitationAmount | unit("precip", current.precipitationUnits) }} +
+ {% endif %} + {% if config.showPrecipitationProbability and current.precipitationProbability %} + {{ "PRECIP_POP" | translate }} {{ current.precipitationProbability }}% + {% endif %} +
+ {% endif %} + {% if config.showHumidity === "below" %} + {{ humidity() }} + {% endif %} {% else %} -
{{ "LOADING" | translate }}
+
{{ "LOADING" | translate }}
{% endif %} - + diff --git a/modules/default/weather/forecast.njk b/modules/default/weather/forecast.njk index 85570fbb..91fef6ab 100644 --- a/modules/default/weather/forecast.njk +++ b/modules/default/weather/forecast.njk @@ -1,52 +1,46 @@ {% if forecast %} - {% set numSteps = forecast | calcNumSteps %} - {% set currentStep = 0 %} - - {% if config.ignoreToday %} - {% set forecast = forecast.splice(1) %} + {% set numSteps = forecast | calcNumSteps %} + {% set currentStep = 0 %} +
+ {% if config.ignoreToday %} + {% set forecast = forecast.splice(1) %} + {% endif %} + {% set forecast = forecast.slice(0, numSteps) %} + {% for f in forecast %} + + {% if (currentStep == 0) and config.ignoreToday == false and config.absoluteDates == false %} + + {% elif (currentStep == 1) and config.ignoreToday == false and config.absoluteDates == false %} + + {% else %} + {% endif %} - {% set forecast = forecast.slice(0, numSteps) %} - {% for f in forecast %} - - {% if (currentStep == 0) and config.ignoreToday == false and config.absoluteDates == false %} - - {% elif (currentStep == 1) and config.ignoreToday == false and config.absoluteDates == false %} - - {% else %} - - {% endif %} - - - - {% if config.showPrecipitationAmount %} - - {% endif %} - {% if config.showPrecipitationProbability %} - - {% endif %} - {% if config.showUVIndex %} - - {% endif %} - - {% set currentStep = currentStep + 1 %} - {% endfor %} -
{{ "TODAY" | translate }}{{ "TOMORROW" | translate }}{{ f.date.format("ddd") }}
{{ "TODAY" | translate }}{{ "TOMORROW" | translate }}{{ f.date.format("ddd") }} - - - {{ f.maxTemperature | roundValue | unit("temperature") | decimalSymbol }} - - {{ f.minTemperature | roundValue | unit("temperature") | decimalSymbol }} - - {{ f.precipitationAmount | unit("precip", f.precipitationUnits) }} - - {{ f.precipitationProbability | unit('precip', '%') }} - - {{ f.uv_index }} - -
+ + + + {{ f.maxTemperature | roundValue | unit("temperature") | decimalSymbol }} + {{ f.minTemperature | roundValue | unit("temperature") | decimalSymbol }} + {% if config.showPrecipitationAmount %} + {{ f.precipitationAmount | unit("precip", f.precipitationUnits) }} + {% endif %} + {% if config.showPrecipitationProbability %} + {{ f.precipitationProbability | unit('precip', '%') }} + {% endif %} + {% if config.showUVIndex %} + + {{ f.uv_index }} + + + {% endif %} + + {% set currentStep = currentStep + 1 %} + {% endfor %} + {% else %} -
{{ "LOADING" | translate }}
+
{{ "LOADING" | translate }}
{% endif %} - + diff --git a/modules/default/weather/hourly.njk b/modules/default/weather/hourly.njk index 4223390b..05416de7 100644 --- a/modules/default/weather/hourly.njk +++ b/modules/default/weather/hourly.njk @@ -1,52 +1,48 @@ {% if hourly %} - {% set numSteps = hourly | calcNumEntries %} - {% set currentStep = 0 %} - - {% set hours = hourly.slice(0, numSteps) %} - {% for hour in hours %} - - - - - {% if config.showUVIndex %} - - {% endif %} - {% if config.showHumidity != "none" %} - - {% endif %} - {% if config.showPrecipitationAmount %} - {% if (not config.hideZeroes or hour.precipitationAmount>0) %} - - {% endif %} - {% endif %} - {% if config.showPrecipitationProbability %} - {% if (not config.hideZeroes or hour.precipitationAmount>0) %} - - {% endif %} - {% endif %} - - {% set currentStep = currentStep + 1 %} - {% endfor %} -
{{ hour.date | formatTime }} - - - {{ hour.temperature | roundValue | unit("temperature") }} - - {% if hour.uv_index!=0 %} - {{ hour.uv_index }} - - {% endif %} - - {{ hour.humidity }} - - - {{ hour.precipitationAmount | unit("precip", hour.precipitationUnits) }} - - {{ hour.precipitationProbability | unit('precip', '%') }} -
+ {% set numSteps = hourly | calcNumEntries %} + {% set currentStep = 0 %} + + {% set hours = hourly.slice(0, numSteps) %} + {% for hour in hours %} + + + + + {% if config.showUVIndex %} + + {% endif %} + {% if config.showHumidity != "none" %} + + {% endif %} + {% if config.showPrecipitationAmount %} + {% if (not config.hideZeroes or hour.precipitationAmount>0) %} + + {% endif %} + {% endif %} + {% if config.showPrecipitationProbability %} + {% if (not config.hideZeroes or hour.precipitationAmount>0) %} + + {% endif %} + {% endif %} + + {% set currentStep = currentStep + 1 %} + {% endfor %} +
{{ hour.date | formatTime }} + + {{ hour.temperature | roundValue | unit("temperature") }} + {% if hour.uv_index!=0 %} + {{ hour.uv_index }} + + {% endif %} + + {{ hour.humidity }} + + {{ hour.precipitationAmount | unit("precip", hour.precipitationUnits) }}{{ hour.precipitationProbability | unit('precip', '%') }}
{% else %} -
{{ "LOADING" | translate }}
+
{{ "LOADING" | translate }}
{% endif %} - + diff --git a/package-lock.json b/package-lock.json index d0774712..dc460bc2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -52,6 +52,7 @@ "markdownlint-cli2": "^0.18.1", "playwright": "^1.55.0", "prettier": "^3.6.2", + "prettier-plugin-jinja-template": "^2.1.0", "stylelint": "^16.24.0", "stylelint-config-standard": "^39.0.0", "stylelint-prettier": "^5.0.3" @@ -11763,6 +11764,16 @@ "node": ">=6.0.0" } }, + "node_modules/prettier-plugin-jinja-template": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/prettier-plugin-jinja-template/-/prettier-plugin-jinja-template-2.1.0.tgz", + "integrity": "sha512-mzoCp2Oy9BDSug80fw3B3J4n4KQj1hRvoQOL1akqcDKBb5nvYxrik9zUEDs4AEJ6nK7QDTGoH0y9rx7AlnQ78Q==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "prettier": "^3.0.0" + } + }, "node_modules/pretty-format": { "version": "30.0.5", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-30.0.5.tgz", diff --git a/package.json b/package.json index 81389b4f..9d47abf0 100644 --- a/package.json +++ b/package.json @@ -111,6 +111,7 @@ "markdownlint-cli2": "^0.18.1", "playwright": "^1.55.0", "prettier": "^3.6.2", + "prettier-plugin-jinja-template": "^2.1.0", "stylelint": "^16.24.0", "stylelint-config-standard": "^39.0.0", "stylelint-prettier": "^5.0.3" diff --git a/prettier.config.mjs b/prettier.config.mjs index 7ec216b4..4a626332 100644 --- a/prettier.config.mjs +++ b/prettier.config.mjs @@ -1,10 +1,17 @@ const config = { + plugins: ["prettier-plugin-jinja-template"], overrides: [ { files: "*.md", options: { parser: "markdown" } + }, + { + files: ["*.njk"], + options: { + parser: "jinja-template" + } } ], trailingComma: "none"