From 4325f950f1a59a4c7f4886682d2685f39e0d6709 Mon Sep 17 00:00:00 2001 From: monosans Date: Mon, 10 Feb 2025 09:34:27 +0300 Subject: [PATCH] chore: enable objectWrap in prettier --- .github/renovate.json | 23 +- .pre-commit-config.yaml | 1 + docs/.eleventy.js | 41 +-- docs/src/_data/configuration.json | 346 +++++----------------- docs/src/_data/eleventyComputed.js | 8 +- docs/src/_data/i18n/index.js | 42 +-- docs/src/_data/js.js | 4 +- docs/src/_data/locales.js | 18 +- docs/src/docs/configuration.md | 4 +- docs/src/docs/docs.json | 5 +- docs/src/docs/languages/languages.json | 4 +- docs/src/fr/docs/configuration.md | 4 +- docs/src/fr/docs/docs.json | 4 +- docs/src/fr/docs/languages/languages.json | 4 +- docs/src/fr/fr.json | 5 +- docs/src/ru/docs/configuration.md | 4 +- docs/src/ru/docs/docs.json | 4 +- docs/src/ru/docs/languages/languages.json | 4 +- docs/src/ru/ru.json | 5 +- docs/src/static/js/editor.js | 22 +- prettier.config.mjs | 1 + 21 files changed, 110 insertions(+), 443 deletions(-) diff --git a/.github/renovate.json b/.github/renovate.json index 32c7c540f..762dcdf56 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -2,14 +2,9 @@ "$schema": "https://docs.renovatebot.com/renovate-schema.json", "configMigration": true, "dependencyDashboard": false, - "docker-compose": { - "enabled": true - }, + "docker-compose": { "enabled": true }, "extends": ["config:recommended"], - "lockFileMaintenance": { - "enabled": true, - "schedule": ["at any time"] - }, + "lockFileMaintenance": { "enabled": true, "schedule": ["at any time"] }, "packageRules": [ { "matchUpdateTypes": ["minor"], @@ -25,20 +20,12 @@ ], "automerge": true }, - { - "matchDepTypes": ["devDependencies"], - "automerge": true - }, - { - "matchManagers": ["pre-commit"], - "automerge": true - } + { "matchDepTypes": ["devDependencies"], "automerge": true }, + { "matchManagers": ["pre-commit"], "automerge": true } ], "prConcurrentLimit": 0, "prHourlyLimit": 0, - "pre-commit": { - "enabled": true - }, + "pre-commit": { "enabled": true }, "rollbackPrs": true, "semanticCommits": "enabled", "schedule": ["at any time"] diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5167fc4e4..d27599256 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,6 +22,7 @@ repos: hooks: - id: prettier args: + - --objectWrap=collapse - --no-config - repo: https://github.com/charliermarsh/ruff-pre-commit rev: v0.9.5 diff --git a/docs/.eleventy.js b/docs/.eleventy.js index ad39e3605..e074c4557 100644 --- a/docs/.eleventy.js +++ b/docs/.eleventy.js @@ -31,21 +31,12 @@ async function imageShortcode( let metadata = await Image(src, { widths: [24, 300, 400, 500, 600, 800, 1200], formats: ["webp", "png"], - sharpWebpOptions: { - options: { - quality: 70, - }, - }, + sharpWebpOptions: { options: { quality: 70 } }, outputDir: "./_site/static/img/", urlPath: "/static/img/", }); - let imageAttributes = { - alt, - sizes, - loading: loading, - decoding: decoding, - }; + let imageAttributes = { alt, sizes, loading: loading, decoding: decoding }; if (type == "boxed") { return ( @@ -105,10 +96,7 @@ module.exports = function (eleventyConfig) { eleventyConfig.addPlugin(schema); eleventyConfig.addPlugin(rollupper, { rollup: { - output: { - format: "umd", - dir: "_site/static/js", - }, + output: { format: "umd", dir: "_site/static/js" }, plugins: [nodeResolve()], }, }); @@ -121,12 +109,7 @@ module.exports = function (eleventyConfig) { github_edit_text: (page) => { i18n_options = Object.assign( {}, - { - translations, - fallbackLocales: { - "*": "en-US", - }, - }, + { translations, fallbackLocales: { "*": "en-US" } }, ); return `${i18n_func( @@ -195,14 +178,10 @@ module.exports = function (eleventyConfig) { }); // copy images - eleventyConfig.addPassthroughCopy({ - "src/static/img": "static/img", - }); + eleventyConfig.addPassthroughCopy({ "src/static/img": "static/img" }); // copy robots - eleventyConfig.addPassthroughCopy({ - "src/robots.txt": "robots.txt", - }); + eleventyConfig.addPassthroughCopy({ "src/robots.txt": "robots.txt" }); // copy favicon eleventyConfig.addPassthroughCopy({ @@ -210,9 +189,7 @@ module.exports = function (eleventyConfig) { }); // copy wheels - eleventyConfig.addPassthroughCopy({ - "src/static/py": "static/py", - }); + eleventyConfig.addPassthroughCopy({ "src/static/py": "static/py" }); // copy python eleventyConfig.addPassthroughCopy({ @@ -339,9 +316,7 @@ module.exports = function (eleventyConfig) { eleventyConfig.addPlugin(i18n, { translations, - fallbackLocales: { - "*": "en-US", - }, + fallbackLocales: { "*": "en-US" }, }); eleventyConfig.addFilter("baseUrl", (text) => { diff --git a/docs/src/_data/configuration.json b/docs/src/_data/configuration.json index aa2641417..ec18d0e22 100644 --- a/docs/src/_data/configuration.json +++ b/docs/src/_data/configuration.json @@ -6,12 +6,7 @@ "ru": "Возвращать ошибки в виде предупреждений.", "fr": "Renvoyer les erreurs sous forme d'avertissements." }, - "usage": [ - { - "name": "cli", - "value": "--warn" - } - ], + "usage": [{ "name": "cli", "value": "--warn" }], "tags": ["formatter", "linter"] }, { @@ -21,12 +16,7 @@ "ru": "Покажите версию и выйдите.", "fr": "Afficher la version et quitter." }, - "usage": [ - { - "name": "cli", - "value": "--version" - } - ], + "usage": [{ "name": "cli", "value": "--version" }], "tags": ["formatter", "linter"] }, { @@ -36,12 +26,7 @@ "ru": "Не печатайте diff при переформатировании.", "fr": "N'imprimez pas de différences lors du reformatage." }, - "usage": [ - { - "name": "cli", - "value": "--quiet" - } - ], + "usage": [{ "name": "cli", "value": "--quiet" }], "tags": ["formatter", "linter"] }, { @@ -52,18 +37,9 @@ "fr": "Consolider les lignes vierges en les ramenant à x lignes. La valeur par défaut est 0, ce qui signifie que les lignes vierges seront supprimées." }, "usage": [ - { - "name": "pyproject.toml", - "value": "max_blank_lines=5" - }, - { - "name": ".djlintrc", - "value": "\"max_blank_lines\": 5" - }, - { - "name": "cli", - "value": "--max_blank_lines 5" - } + { "name": "pyproject.toml", "value": "max_blank_lines=5" }, + { "name": ".djlintrc", "value": "\"max_blank_lines\": 5" }, + { "name": "cli", "value": "--max_blank_lines 5" } ], "tags": ["formatter"] }, @@ -75,18 +51,9 @@ "fr": "Ne pas tenter de formater le contenu du jeu. ** Si vous utilisez cette option, veuillez ouvrir un problème gh en expliquant ce qui vous a poussé à l'utiliser" }, "usage": [ - { - "name": "pyproject.toml", - "value": "no_set_formatting=true" - }, - { - "name": ".djlintrc", - "value": "\"no_set_formatting\": true" - }, - { - "name": "cli", - "value": "--no-set-formatting" - } + { "name": "pyproject.toml", "value": "no_set_formatting=true" }, + { "name": ".djlintrc", "value": "\"no_set_formatting\": true" }, + { "name": "cli", "value": "--no-set-formatting" } ], "tags": ["formatter"] }, @@ -98,18 +65,9 @@ "fr": "Ne pas tenter de formater le contenu de la fonction. ** Si vous utilisez cette option, veuillez ouvrir un problème gh en expliquant ce qui vous a poussé à l'utiliser." }, "usage": [ - { - "name": "pyproject.toml", - "value": "no_function_formatting=true" - }, - { - "name": ".djlintrc", - "value": "\"no_function_formatting\": true" - }, - { - "name": "cli", - "value": "--no-function-formatting" - } + { "name": "pyproject.toml", "value": "no_function_formatting=true" }, + { "name": ".djlintrc", "value": "\"no_function_formatting\": true" }, + { "name": "cli", "value": "--no-function-formatting" } ], "tags": ["formatter"] }, @@ -121,18 +79,9 @@ "fr": "N'ajoutez pas de ligne vierge après la matière première yaml." }, "usage": [ - { - "name": "pyproject.toml", - "value": "no_line_after_yaml=true" - }, - { - "name": ".djlintrc", - "value": "\"no_line_after_yaml\": true" - }, - { - "name": "cli", - "value": "--no-line-after-yaml" - } + { "name": "pyproject.toml", "value": "no_line_after_yaml=true" }, + { "name": ".djlintrc", "value": "\"no_line_after_yaml\": true" }, + { "name": "cli", "value": "--no-line-after-yaml" } ], "tags": ["formatter"] }, @@ -144,18 +93,9 @@ "fr": "Fermer les étiquettes vides." }, "usage": [ - { - "name": "pyproject.toml", - "value": "close_void_tags=true" - }, - { - "name": ".djlintrc", - "value": "\"close_void_tags\": true" - }, - { - "name": "cli", - "value": "--close-void-tags" - } + { "name": "pyproject.toml", "value": "close_void_tags=true" }, + { "name": ".djlintrc", "value": "\"close_void_tags\": true" }, + { "name": "cli", "value": "--close-void-tags" } ], "tags": ["formatter"] }, @@ -167,18 +107,9 @@ "fr": "Ignore les codes de linter." }, "usage": [ - { - "name": "pyproject.toml", - "value": "ignore=\"H014,H015\"" - }, - { - "name": ".djlintrc", - "value": "\"ignore\": \"H014,H015\"" - }, - { - "name": "cli", - "value": "--ignore \"H014,H015\"" - } + { "name": "pyproject.toml", "value": "ignore=\"H014,H015\"" }, + { "name": ".djlintrc", "value": "\"ignore\": \"H014,H015\"" }, + { "name": "cli", "value": "--ignore \"H014,H015\"" } ], "tags": ["linter"] }, @@ -191,18 +122,9 @@ }, "tags": ["linter"], "usage": [ - { - "name": "pyproject.toml", - "value": "include=\"H014,H015\"" - }, - { - "name": ".djlintrc", - "value": "\"include\": \"H014,H015\"" - }, - { - "name": "cli", - "value": "--include \"H014,H015\"" - } + { "name": "pyproject.toml", "value": "include=\"H014,H015\"" }, + { "name": ".djlintrc", "value": "\"include\": \"H014,H015\"" }, + { "name": "cli", "value": "--include \"H014,H015\"" } ] }, { @@ -214,14 +136,8 @@ }, "tags": ["linter", "formatter"], "usage": [ - { - "name": "pyproject.toml", - "value": "extension=\"html.dj\"" - }, - { - "name": ".djlintrc", - "value": "\"extension\": \"html.dj\"" - }, + { "name": "pyproject.toml", "value": "extension=\"html.dj\"" }, + { "name": ".djlintrc", "value": "\"extension\": \"html.dj\"" }, { "name": "cli", "value": "--extension \"html.dj\"\n# or\n-e \"html.dj\"" @@ -237,18 +153,9 @@ }, "tags": ["formatter"], "usage": [ - { - "name": "pyproject.toml", - "value": "custom_blocks=\"toc,example\"" - }, - { - "name": ".djlintrc", - "value": "\"custom_blocks\": \"toc,example\"" - }, - { - "name": "cli", - "value": "--custom-blocks \"toc,example\"" - } + { "name": "pyproject.toml", "value": "custom_blocks=\"toc,example\"" }, + { "name": ".djlintrc", "value": "\"custom_blocks\": \"toc,example\"" }, + { "name": "cli", "value": "--custom-blocks \"toc,example\"" } ] }, { @@ -260,18 +167,9 @@ }, "tags": ["formatter"], "usage": [ - { - "name": "pyproject.toml", - "value": "ignore_blocks=\"raw,example\"" - }, - { - "name": ".djlintrc", - "value": "\"ignore_blocks\": \"raw,example\"" - }, - { - "name": "cli", - "value": "--ignore-blocks \"raw,example\"" - } + { "name": "pyproject.toml", "value": "ignore_blocks=\"raw,example\"" }, + { "name": ".djlintrc", "value": "\"ignore_blocks\": \"raw,example\"" }, + { "name": "cli", "value": "--ignore-blocks \"raw,example\"" } ] }, { @@ -306,18 +204,9 @@ "fr": "Permet de modifier l'indentation du code. La valeur par défaut est 4 (quatre espaces)." }, "usage": [ - { - "name": "pyproject.toml", - "value": "indent=3" - }, - { - "name": ".djlintrc", - "value": "\"indent\": \"3\"" - }, - { - "name": "cli", - "value": "--indent 3" - } + { "name": "pyproject.toml", "value": "indent=3" }, + { "name": ".djlintrc", "value": "\"indent\": \"3\"" }, + { "name": "cli", "value": "--indent 3" } ] }, { @@ -337,10 +226,7 @@ "name": ".djlintrc", "value": "\"exclude\": \".venv,venv,.tox,.eggs,...\"" }, - { - "name": "cli", - "value": "--exclude \".venv,venv,.tox,.eggs,...\"" - } + { "name": "cli", "value": "--exclude \".venv,venv,.tox,.eggs,...\"" } ] }, { @@ -352,18 +238,9 @@ "fr": "Ajouter des chemins supplémentaires à l'exclusion par défaut." }, "usage": [ - { - "name": "pyproject.toml", - "value": "extend_exclude=\".custom\"" - }, - { - "name": ".djlintrc", - "value": "\"extend_exclude\": \".custom\"" - }, - { - "name": "cli", - "value": "--extend-exclude \".custom\"" - } + { "name": "pyproject.toml", "value": "extend_exclude=\".custom\"" }, + { "name": ".djlintrc", "value": "\"extend_exclude\": \".custom\"" }, + { "name": "cli", "value": "--extend-exclude \".custom\"" } ] }, { @@ -429,10 +306,7 @@ "name": ".djlintrc", "value": "\"line_break_after_multiline_tag\": \"true\"" }, - { - "name": "cli", - "value": "--line-break-after-multiline-tag" - } + { "name": "cli", "value": "--line-break-after-multiline-tag" } ] }, { @@ -444,18 +318,9 @@ "fr": "Définissez un profil pour la langue du modèle. Le profil activera les règles de linter qui s'appliquent à votre langage de modèle, et peut également changer le reformatage. Par exemple, dans `handlebars`, il n'y a pas d'espaces dans les balises `{{#if}}`.\n\nOptions:\n\n:::content\n\n- html (default)\n- django\n- jinja\n- nunjucks (for nunjucks and twig)\n- handlebars (for handlebars and mustache)\n- golang\n- angular\n :::" }, "usage": [ - { - "name": "pyproject.toml", - "value": "profile=\"django\"" - }, - { - "name": ".djlintrc", - "value": "\"profile\": \"django\"" - }, - { - "name": "cli", - "value": "--profile \"django\"" - } + { "name": "pyproject.toml", "value": "profile=\"django\"" }, + { "name": ".djlintrc", "value": "\"profile\": \"django\"" }, + { "name": "cli", "value": "--profile \"django\"" } ] }, { @@ -467,18 +332,9 @@ "fr": "Ne formatez ou ne limez que les fichiers qui commencent par un commentaire contenant uniquement le texte 'djlint:on'. Le commentaire peut être un commentaire HTML ou un commentaire dans le langage de modèle défini par le paramètre de profil. Si aucun profil n'est spécifié, un commentaire dans l'un des langages de modèle est accepté.\n\n```html\n\n{# djlint:on #}\n{% comment %} djlint:on {% endcomment %}\n{{ /* djlint:on */ }}\n{{!-- djlint:on --}}\n```\n" }, "usage": [ - { - "name": "pyproject.toml", - "value": "require_pragma=true" - }, - { - "name": ".djlintrc", - "value": "\"require_pragma\": true" - }, - { - "name": "cli", - "value": "--require_pragma" - } + { "name": "pyproject.toml", "value": "require_pragma=true" }, + { "name": ".djlintrc", "value": "\"require_pragma\": true" }, + { "name": "cli", "value": "--require_pragma" } ] }, { @@ -490,18 +346,9 @@ "fr": "Le formateur essaiera de mettre certaines balises html et template sur une seule ligne au lieu de les envelopper si la longueur de la ligne ne dépasse pas cette valeur." }, "usage": [ - { - "name": "pyproject.toml", - "value": "max_line_length=120" - }, - { - "name": ".djlintrc", - "value": "\"max_line_length\": \"120\"" - }, - { - "name": "cli", - "value": "--max_line_length 120" - } + { "name": "pyproject.toml", "value": "max_line_length=120" }, + { "name": ".djlintrc", "value": "\"max_line_length\": \"120\"" }, + { "name": "cli", "value": "--max_line_length 120" } ] }, { @@ -513,18 +360,9 @@ "fr": "Le formateur tentera d'envelopper les attributs de la balise si la longueur de l'attribut dépasse cette valeur." }, "usage": [ - { - "name": "pyproject.toml", - "value": "max_attribute_length=10" - }, - { - "name": ".djlintrc", - "value": "\"max_attribute_length\": \"10\"" - }, - { - "name": "cli", - "value": "--max-attribute-length 10" - } + { "name": "pyproject.toml", "value": "max_attribute_length=10" }, + { "name": ".djlintrc", "value": "\"max_attribute_length\": \"10\"" }, + { "name": "cli", "value": "--max-attribute-length 10" } ] }, { @@ -536,18 +374,9 @@ "fr": "Ajouter les exclusions .gitignore à l'exclusion par défaut." }, "usage": [ - { - "name": "pyproject.toml", - "value": "use_gitignore=true" - }, - { - "name": ".djlintrc", - "value": "\"use_gitignore\": true" - }, - { - "name": "cli", - "value": "--use_gitignore" - } + { "name": "pyproject.toml", "value": "use_gitignore=true" }, + { "name": ".djlintrc", "value": "\"use_gitignore\": true" }, + { "name": "cli", "value": "--use_gitignore" } ] }, { @@ -567,10 +396,7 @@ "name": ".djlintrc", "value": "\"format_attribute_template_tags\": true" }, - { - "name": "cli", - "value": "--format-attribute-template-tags" - } + { "name": "cli", "value": "--format-attribute-template-tags" } ] }, { @@ -605,18 +431,9 @@ "fr": "Préserve l'espace de tête du texte, dans la mesure du possible. Idéal pour les fichiers de modèles non-html où l'indentation du texte est intentionnelle." }, "usage": [ - { - "name": "pyproject.toml", - "value": "preserve_leading_space=true" - }, - { - "name": ".djlintrc", - "value": "\"preserve_leading_space\": true" - }, - { - "name": "cli", - "value": "--preserve_leading_space" - } + { "name": "pyproject.toml", "value": "preserve_leading_space=true" }, + { "name": ".djlintrc", "value": "\"preserve_leading_space\": true" }, + { "name": "cli", "value": "--preserve_leading_space" } ] }, { @@ -628,18 +445,9 @@ "fr": "Préserve les blancs lorsque cela est possible. Idéal pour les fichiers de modèles non-html où les lignes vides sont intentionnelles." }, "usage": [ - { - "name": "pyproject.toml", - "value": "preserve_blank_lines=true" - }, - { - "name": ".djlintrc", - "value": "\"preserve_blank_lines\": true" - }, - { - "name": "cli", - "value": "--preserve_blank_lines" - } + { "name": "pyproject.toml", "value": "preserve_blank_lines=true" }, + { "name": ".djlintrc", "value": "\"preserve_blank_lines\": true" }, + { "name": "cli", "value": "--preserve_blank_lines" } ] }, { @@ -682,10 +490,7 @@ "name": ".djlintrc", "value": "\"format_js\": true\n\"js\": {\n \"indent_size\": 5\n }" }, - { - "name": "cli", - "value": "--format-js --indent-js 5" - } + { "name": "cli", "value": "--format-js --indent-js 5" } ] }, { @@ -705,10 +510,7 @@ "name": ".djlintrc", "value": "\"format_css\": true\n\"css\": {\n \"indent_size\": 5\n }" }, - { - "name": "cli", - "value": "--format-css --indent-css 5" - } + { "name": "cli", "value": "--format-css --indent-css 5" } ] }, { @@ -724,14 +526,8 @@ "name": "pyproject.toml", "value": "[tool.djlint]\nfiles=[\"index.html\"]\n" }, - { - "name": ".djlintrc", - "value": "\"files\": [\n \"index.html\"\n]" - }, - { - "name": "cli", - "value": "index.html" - } + { "name": ".djlintrc", "value": "\"files\": [\n \"index.html\"\n]" }, + { "name": "cli", "value": "index.html" } ] }, { @@ -747,14 +543,8 @@ "name": "pyproject.toml", "value": "[tool.djlint]\nignore_case=true\n" }, - { - "name": ".djlintrc", - "value": "\"ignore_case\": true" - }, - { - "name": "cli", - "value": "--ignore_case" - } + { "name": ".djlintrc", "value": "\"ignore_case\": true" }, + { "name": "cli", "value": "--ignore_case" } ] } ] diff --git a/docs/src/_data/eleventyComputed.js b/docs/src/_data/eleventyComputed.js index 2d810a3cf..497a7274b 100644 --- a/docs/src/_data/eleventyComputed.js +++ b/docs/src/_data/eleventyComputed.js @@ -5,17 +5,13 @@ module.exports = { name: (data) => data.site.title, description: (data) => data.site.description, url: (data) => data.site.url, - logo: { - src: (data) => data.site.image, - }, + logo: { src: (data) => data.site.image }, }, language: "en-US", url: (data) => data.site.url + data.page.url, title: (data) => data.title || data.site.title, description: (data) => data.description || data.site.description, - image: { - src: (data) => data.page.image, - }, + image: { src: (data) => data.page.image }, modified: (data) => data.page.date.toISOString(), keywords: (data) => data.keywords, }, diff --git a/docs/src/_data/i18n/index.js b/docs/src/_data/i18n/index.js index 4a55f9542..44458fd94 100644 --- a/docs/src/_data/i18n/index.js +++ b/docs/src/_data/i18n/index.js @@ -1,9 +1,5 @@ module.exports = { - hello: { - "en-US": "Hello", - ru: "Hola", - fr: "Salut", - }, + hello: { "en-US": "Hello", ru: "Hola", fr: "Salut" }, title: { "en-US": "HTML Template Linter and Formatter", ru: "Программа проверки и форматирования шаблонов HTML", @@ -17,11 +13,7 @@ module.exports = { // 'en-US': "en", // ru: "ru" // }, - lang_code_url: { - "en-US": "", - ru: "/ru", - fr: "/fr", - }, + lang_code_url: { "en-US": "", ru: "/ru", fr: "/fr" }, next_release: { "en-US": "Next Release", ru: "Следующая публикация", @@ -32,16 +24,8 @@ module.exports = { ru: "Начало Работы", fr: "Commencer", }, - formatter: { - "en-US": "Formatter", - ru: "Форматер", - fr: "Formateur", - }, - linter: { - "en-US": "Linter", - ru: "Линтер", - fr: "Linter", - }, + formatter: { "en-US": "Formatter", ru: "Форматер", fr: "Formateur" }, + linter: { "en-US": "Linter", ru: "Линтер", fr: "Linter" }, configuration: { "en-US": "Configuration", ru: "Конфигурация", @@ -63,16 +47,8 @@ module.exports = { ru: "Найдите распространенные синтаксические ошибки, переформатируйте, чтобы ваши HTML-шаблоны сияли! Поддерживает django, jinja, nunjucks, twig, handlebars, mustache, golang и многое другое!", fr: "Trouvez les erreurs de syntaxe courantes, reformatez pour faire briller vos modèles HTML ! Supporte django, jinja, nunjucks, twig, handlebars, mustache, golang, et plus encore !", }, - updated: { - "en-US": "Updated", - ru: "Обновлен", - fr: "Actualisé", - }, - changelog: { - "en-US": "Changelog", - ru: "Изменения", - fr: "Changelog", - }, + updated: { "en-US": "Updated", ru: "Обновлен", fr: "Actualisé" }, + changelog: { "en-US": "Changelog", ru: "Изменения", fr: "Changelog" }, documentation: { "en-US": "Documentation", ru: "Документация", @@ -114,11 +90,7 @@ module.exports = { ru: "Выглядит вот так:", fr: "Ça ressemble à ça:", }, - contributing: { - "en-US": "Contributing", - ru: "Вклад", - fr: "Contribuer", - }, + contributing: { "en-US": "Contributing", ru: "Вклад", fr: "Contribuer" }, contributing_message: { "en-US": 'Contributions are welcome. Send a pr with a new feature, or checkout the issue list and help where you can.', diff --git a/docs/src/_data/js.js b/docs/src/_data/js.js index bc050a55f..75719efd7 100644 --- a/docs/src/_data/js.js +++ b/docs/src/_data/js.js @@ -2,6 +2,4 @@ const generateContentHash = require("../lib/generate-content-hash.js"); const hash = generateContentHash("src/static/js/**/*.js"); -module.exports = { - scriptsJs: `/static/js/${hash}.js`, -}; +module.exports = { scriptsJs: `/static/js/${hash}.js` }; diff --git a/docs/src/_data/locales.js b/docs/src/_data/locales.js index 7efd25a6a..f4d734b16 100644 --- a/docs/src/_data/locales.js +++ b/docs/src/_data/locales.js @@ -1,17 +1,5 @@ module.exports = [ - { - label: "English", - code: "en-US", - url: "", - }, - { - label: "Русский", - code: "ru", - url: "ru", - }, - { - label: "Français", - code: "fr", - url: "fr", - }, + { label: "English", code: "en-US", url: "" }, + { label: "Русский", code: "ru", url: "ru" }, + { label: "Français", code: "fr", url: "fr" }, ]; diff --git a/docs/src/docs/configuration.md b/docs/src/docs/configuration.md index e067a9a49..f8ea97d50 100644 --- a/docs/src/docs/configuration.md +++ b/docs/src/docs/configuration.md @@ -25,9 +25,7 @@ The format for `djlint.toml` is `toml`. The format for `.djlintrc` is `json`. ```json -{ - "option": "value" -} +{ "option": "value" } ``` ## Options diff --git a/docs/src/docs/docs.json b/docs/src/docs/docs.json index dc58bd245..d9e1a51c8 100644 --- a/docs/src/docs/docs.json +++ b/docs/src/docs/docs.json @@ -1,4 +1 @@ -{ - "layout": "docs_layout.njk", - "date": "git Last Modified" -} +{ "layout": "docs_layout.njk", "date": "git Last Modified" } diff --git a/docs/src/docs/languages/languages.json b/docs/src/docs/languages/languages.json index 62947763b..a901df61f 100644 --- a/docs/src/docs/languages/languages.json +++ b/docs/src/docs/languages/languages.json @@ -1,3 +1 @@ -{ - "layout": "languages_layout.njk" -} +{ "layout": "languages_layout.njk" } diff --git a/docs/src/fr/docs/configuration.md b/docs/src/fr/docs/configuration.md index 2ee8f4ad0..7436a41a5 100644 --- a/docs/src/fr/docs/configuration.md +++ b/docs/src/fr/docs/configuration.md @@ -24,9 +24,7 @@ Le format de `djlint.toml` est `toml`. Le format de `.djlintrc` est `json`. ```json -{ - "option": "valeur" -} +{ "option": "valeur" } ``` ## Options diff --git a/docs/src/fr/docs/docs.json b/docs/src/fr/docs/docs.json index 9b6b75ed7..8ddbdf1a0 100644 --- a/docs/src/fr/docs/docs.json +++ b/docs/src/fr/docs/docs.json @@ -1,3 +1 @@ -{ - "layout": "docs_layout.njk" -} +{ "layout": "docs_layout.njk" } diff --git a/docs/src/fr/docs/languages/languages.json b/docs/src/fr/docs/languages/languages.json index 62947763b..a901df61f 100644 --- a/docs/src/fr/docs/languages/languages.json +++ b/docs/src/fr/docs/languages/languages.json @@ -1,3 +1 @@ -{ - "layout": "languages_layout.njk" -} +{ "layout": "languages_layout.njk" } diff --git a/docs/src/fr/fr.json b/docs/src/fr/fr.json index f41eae3b3..6b1c51068 100644 --- a/docs/src/fr/fr.json +++ b/docs/src/fr/fr.json @@ -1,4 +1 @@ -{ - "dir": "ltr", - "locale": "fr" -} +{ "dir": "ltr", "locale": "fr" } diff --git a/docs/src/ru/docs/configuration.md b/docs/src/ru/docs/configuration.md index c72e2c74c..58479ddef 100644 --- a/docs/src/ru/docs/configuration.md +++ b/docs/src/ru/docs/configuration.md @@ -24,9 +24,7 @@ keywords: облицовка шаблонов, форматер шаблонов Формат файла `.djlintrc` - `json`. ```json -{ - "ключ": "значение" -} +{ "ключ": "значение" } ``` ## Опции diff --git a/docs/src/ru/docs/docs.json b/docs/src/ru/docs/docs.json index 9b6b75ed7..8ddbdf1a0 100644 --- a/docs/src/ru/docs/docs.json +++ b/docs/src/ru/docs/docs.json @@ -1,3 +1 @@ -{ - "layout": "docs_layout.njk" -} +{ "layout": "docs_layout.njk" } diff --git a/docs/src/ru/docs/languages/languages.json b/docs/src/ru/docs/languages/languages.json index 62947763b..a901df61f 100644 --- a/docs/src/ru/docs/languages/languages.json +++ b/docs/src/ru/docs/languages/languages.json @@ -1,3 +1 @@ -{ - "layout": "languages_layout.njk" -} +{ "layout": "languages_layout.njk" } diff --git a/docs/src/ru/ru.json b/docs/src/ru/ru.json index 61ebbae12..0f65a37d6 100644 --- a/docs/src/ru/ru.json +++ b/docs/src/ru/ru.json @@ -1,4 +1 @@ -{ - "dir": "ltr", - "locale": "ru" -} +{ "dir": "ltr", "locale": "ru" } diff --git a/docs/src/static/js/editor.js b/docs/src/static/js/editor.js index bfca045f4..4d97b3791 100644 --- a/docs/src/static/js/editor.js +++ b/docs/src/static/js/editor.js @@ -89,11 +89,7 @@ if (typeof Worker !== "undefined") { const runPython = (script) => { session_id += 1; - w.postMessage({ - config: getConfig(), - html: script, - id: session_id, - }); + w.postMessage({ config: getConfig(), html: script, id: session_id }); }; w.onmessage = (event) => { @@ -159,25 +155,13 @@ if (typeof Worker !== "undefined") { function setOutput(stdout) { const currentValue = output.state.doc.toString(); const endPosition = currentValue.length; - output.dispatch({ - changes: { - from: 0, - to: endPosition, - insert: stdout, - }, - }); + output.dispatch({ changes: { from: 0, to: endPosition, insert: stdout } }); } function setInput(stdout) { const currentValue = editor.state.doc.toString(); const endPosition = currentValue.length; - editor.dispatch({ - changes: { - from: 0, - to: endPosition, - insert: stdout, - }, - }); + editor.dispatch({ changes: { from: 0, to: endPosition, insert: stdout } }); } document.getElementById("djlint-settings").addEventListener("change", () => { diff --git a/prettier.config.mjs b/prettier.config.mjs index 5af0d7d53..49218895b 100644 --- a/prettier.config.mjs +++ b/prettier.config.mjs @@ -2,6 +2,7 @@ * @type {import('prettier').Config & import("@ianvs/prettier-plugin-sort-imports").PluginConfig} */ export default { + objectWrap: "collapse", plugins: [ "@ianvs/prettier-plugin-sort-imports", "prettier-plugin-packagejson",