From 557fd6ac80d8792e01f59d20b7ecf33c5f141e5c Mon Sep 17 00:00:00 2001 From: Erin Date: Mon, 14 Aug 2023 14:07:25 -0400 Subject: [PATCH] add dprint for formatting --- dprint.json | 29 ++++++++++++++ package-lock.json | 97 +++++++++++++++++++++++++++++++++++++++++++++++ package.json | 4 ++ 3 files changed, 130 insertions(+) create mode 100644 dprint.json diff --git a/dprint.json b/dprint.json new file mode 100644 index 0000000..a6ba57b --- /dev/null +++ b/dprint.json @@ -0,0 +1,29 @@ +{ + "typescript": { + "lineWidth": 120, + "useTabs": true, + "quoteStyle": "alwaysSingle", + "quoteProps": "consistent", + "useBraces": "always", + "arrowFunction.useParentheses": "preferNone", + "enumDeclaration.memberSpacing": "newLine", + "spaceSurroundingProperties": false, + "exportDeclaration.spaceSurroundingNamedExports": false, + "importDeclaration.spaceSurroundingNamedImports": false, + "constructor.spaceBeforeParentheses": true, + "functionDeclaration.spaceBeforeParentheses": true, + "functionExpression.spaceBeforeParentheses": true, + "getAccessor.spaceBeforeParentheses": true, + "setAccessor.spaceBeforeParentheses": true, + "method.spaceBeforeParentheses": true + }, + "markdown": {}, + "excludes": [ + "**/node_modules", + "**/*-lock.json" + ], + "plugins": [ + "https://plugins.dprint.dev/typescript-0.86.1.wasm", + "https://plugins.dprint.dev/markdown-0.15.3.wasm" + ] +} diff --git a/package-lock.json b/package-lock.json index de5c154..95a2e22 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,9 +12,88 @@ "@tsconfig/recommended": "^1.0.2", "@types/chrome": "^0.0.242", "@types/node": "^20.5.0", + "dprint": "^0.40.2", "rollup": "^3.26.3" } }, + "node_modules/@dprint/darwin-arm64": { + "version": "0.40.2", + "resolved": "https://registry.npmjs.org/@dprint/darwin-arm64/-/darwin-arm64-0.40.2.tgz", + "integrity": "sha512-qharMFhxpNq9brgvHLbqzzAgVgPWSHLfzNLwWWhKcGOUUDUIilfAo3SlvOz6w4nQiIifLpYZOvZqK7Lpf9mSSw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@dprint/darwin-x64": { + "version": "0.40.2", + "resolved": "https://registry.npmjs.org/@dprint/darwin-x64/-/darwin-x64-0.40.2.tgz", + "integrity": "sha512-FPDdOTVr1JfqtLBTCvqlihWslTy3LBUoi3H1gaqIazCKMj2dB9voFWkBiMT+REMHDrlVsoSpFAfsliNr/y7HPA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@dprint/linux-arm64-glibc": { + "version": "0.40.2", + "resolved": "https://registry.npmjs.org/@dprint/linux-arm64-glibc/-/linux-arm64-glibc-0.40.2.tgz", + "integrity": "sha512-GmUWfKwEwXA+onvewX9hEJSMcd9V184+uRbEhI5tG28tBP9+IjQhrY7jCjxPvaZA+EvzNPnAy5D1wbJdlNLBNA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@dprint/linux-x64-glibc": { + "version": "0.40.2", + "resolved": "https://registry.npmjs.org/@dprint/linux-x64-glibc/-/linux-x64-glibc-0.40.2.tgz", + "integrity": "sha512-vMHAHdsOY+2thieSWbIrIioDfPgvipwUgd0MZUWOqycTrXU6kLyi2B+5J/2Jc+QO3CiLIbumQd2FH/0vB1eWqA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@dprint/linux-x64-musl": { + "version": "0.40.2", + "resolved": "https://registry.npmjs.org/@dprint/linux-x64-musl/-/linux-x64-musl-0.40.2.tgz", + "integrity": "sha512-nFSbDWd9ORyOhJ7a+RmE39WbuPoQ3OQutIgfAmfikiu/wENzEwxxv4QJ7aFnBaoZb0wuVEEpXShr8vY4p0exkg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@dprint/win32-x64": { + "version": "0.40.2", + "resolved": "https://registry.npmjs.org/@dprint/win32-x64/-/win32-x64-0.40.2.tgz", + "integrity": "sha512-qF4VCQzFTZYD61lbQqXLU/IwUTbLK22CancO+uVtXmZRoKU9GaVjcBhMUB7URxsa8rvxWHhHT6ldillI/aOWCg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, "node_modules/@rollup/plugin-typescript": { "version": "11.1.2", "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-11.1.2.tgz", @@ -112,6 +191,24 @@ "integrity": "sha512-Mgq7eCtoTjT89FqNoTzzXg2XvCi5VMhRV6+I2aYanc6kQCBImeNaAYRs/DyoVqk1YEUJK5gN9VO7HRIdz4Wo3Q==", "dev": true }, + "node_modules/dprint": { + "version": "0.40.2", + "resolved": "https://registry.npmjs.org/dprint/-/dprint-0.40.2.tgz", + "integrity": "sha512-3LdyUV0itEW59UPtsRA2StOWOu8FyOW+BgvJpH/tACRHKi0z5gaQnvSxdS3mbG7dgtEhdRnGg6JoiQyGib6NTg==", + "dev": true, + "hasInstallScript": true, + "bin": { + "dprint": "bin.js" + }, + "optionalDependencies": { + "@dprint/darwin-arm64": "0.40.2", + "@dprint/darwin-x64": "0.40.2", + "@dprint/linux-arm64-glibc": "0.40.2", + "@dprint/linux-x64-glibc": "0.40.2", + "@dprint/linux-x64-musl": "0.40.2", + "@dprint/win32-x64": "0.40.2" + } + }, "node_modules/estree-walker": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", diff --git a/package.json b/package.json index 5ac5fde..119a5ab 100644 --- a/package.json +++ b/package.json @@ -3,11 +3,15 @@ "version": "0.0.0", "main": "build/index.js", "type": "module", + "scripts": { + "fmt": "dprint fmt" + }, "devDependencies": { "@rollup/plugin-typescript": "^11.1.2", "@tsconfig/recommended": "^1.0.2", "@types/chrome": "^0.0.242", "@types/node": "^20.5.0", + "dprint": "^0.40.2", "rollup": "^3.26.3" } }