From 1db77ee0c885abdc131e5e18ca93d6c0f9cf2aed Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Wed, 9 Nov 2022 20:03:48 +1000 Subject: [PATCH] Add dprint The plan is to eventually use dprint for most of our formatting, but for now most files are excluded, and this is just going to be used to format our toml files. --- .dprint.json | 25 +++++++++++++++++++++++++ .vscode.dist/extensions.json | 1 + package.json | 1 + yarn.lock | 29 ++++++++++++++++++++++++++++- 4 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 .dprint.json diff --git a/.dprint.json b/.dprint.json new file mode 100644 index 000000000..9cc61e4ff --- /dev/null +++ b/.dprint.json @@ -0,0 +1,25 @@ +{ + "typescript": { + "indentWidth": 4 + }, + "json": { + "indentWidth": 4 + }, + "markdown": {}, + "toml": {}, + "prettier": { + "trailingComma": "all", + "printWidth": 88, + "tabWidth": 4, + "semi": true + }, + "includes": ["**/*.{ts,tsx,js,jsx,cjs,mjs,json,md,toml,svelte}"], + "excludes": ["**/node_modules", "**/*-lock.json", "**/*.{ts,json,md,svelte}", "qt/aqt/data/web/js/vendor/*.js"], + "plugins": [ + "https://plugins.dprint.dev/typescript-0.77.0.wasm", + "https://plugins.dprint.dev/json-0.16.0.wasm", + "https://plugins.dprint.dev/markdown-0.14.1.wasm", + "https://plugins.dprint.dev/toml-0.5.4.wasm", + "https://plugins.dprint.dev/prettier-0.13.0.json@dc5d12b7c1bf1a4683eff317c2c87350e75a5a3dfcc127f3d5628931bfb534b1" + ] +} diff --git a/.vscode.dist/extensions.json b/.vscode.dist/extensions.json index e1a1f88c2..a25760214 100644 --- a/.vscode.dist/extensions.json +++ b/.vscode.dist/extensions.json @@ -1,5 +1,6 @@ { "recommendations": [ + "dprint.dprint", "esbenp.prettier-vscode", "bazelbuild.vscode-bazel", "ms-python.python", diff --git a/package.json b/package.json index ac07bd9d3..8c45f9603 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "chalk": "^4.1.0", "cross-env": "^7.0.2", "diff": "^5.0.0", + "dprint": "^0.32.2", "escodegen": "^2.0.0", "eslint": "^7.24.0", "eslint-plugin-compat": "^3.13.0", diff --git a/yarn.lock b/yarn.lock index c1458d952..3566c04e1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1542,7 +1542,7 @@ bser@2.1.1: dependencies: node-int64 "^0.4.0" -buffer-crc32@^0.2.5: +buffer-crc32@^0.2.5, buffer-crc32@~0.2.3: version "0.2.13" resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" integrity sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI= @@ -2154,6 +2154,13 @@ domexception@^4.0.0: dependencies: webidl-conversions "^7.0.0" +dprint@^0.32.2: + version "0.32.2" + resolved "https://registry.yarnpkg.com/dprint/-/dprint-0.32.2.tgz#42a4da652fbde7de303ac84a52897938cac4abf1" + integrity sha512-cGKnZonCFQkcNbptAtJXlzUOqyiyYoD9pINepJ9PvkFi8iwMLChQDSjhMeqT3DDQf5Rof3pYA5LI/bafPpPknQ== + dependencies: + yauzl "=2.10.0" + electron-to-chromium@^1.4.84: version "1.4.91" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.91.tgz#842bbc97fd639abe7e46e7da530e3af5f6ca2831" @@ -2524,6 +2531,13 @@ fb-watchman@^2.0.0: dependencies: bser "2.1.1" +fd-slicer@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.1.0.tgz#25c7c89cb1f9077f8891bbe61d8f390eae256f1e" + integrity sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g== + dependencies: + pend "~1.2.0" + file-entry-cache@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" @@ -4125,6 +4139,11 @@ path-type@^4.0.0: resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== +pend@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" + integrity sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg== + picocolors@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" @@ -5116,6 +5135,14 @@ yargs@^17.3.1: y18n "^5.0.5" yargs-parser "^21.0.0" +yauzl@=2.10.0: + version "2.10.0" + resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9" + integrity sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g== + dependencies: + buffer-crc32 "~0.2.3" + fd-slicer "~1.1.0" + yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"