From c1d33132e7fd2d9c65fd66d57e655008ac64c4b9 Mon Sep 17 00:00:00 2001 From: jon r Date: Sat, 22 Feb 2025 21:50:00 +0100 Subject: [PATCH] chore(front/package): add fmt scripts and pre-commit prettier boundaries --- front/package.json | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/front/package.json b/front/package.json index 0fd22e693..c74c5a4be 100644 --- a/front/package.json +++ b/front/package.json @@ -16,10 +16,12 @@ "test": "vitest run", "test:unit": "vitest run --coverage", "test:generate-mock-server": "msw-auto-mock ../docs/schema.yml -o test/msw-server.ts --node", - "lint": "eslint --cache --cache-strategy content --ext .ts,.js,.vue,.json,.html src test cypress public/embed.html", - "lint:tsc": "vue-tsc --noEmit --incremental && tsc --noEmit --incremental -p cypress", + "lint": "eslint --cache --cache-strategy content --ext .ts,.js,.vue,.json,.html,.cjs . cypress public/embed.html src test ui-docs", + "lint:tsc": "vue-tsc --noEmit --incremental && tsc --noEmit --incremental -p cypress src test ui-docs", "generate-local-schema": "yarn run openapi-typescript ../api/funkwhale_api/schema.yml -o src/generated/types.ts", - "generate-remote-schema": "yarn run openapi-typescript https://docs.funkwhale.audio/develop/swagger/schema.yml -o src/generated/types.ts" + "generate-remote-schema": "yarn run openapi-typescript https://docs.funkwhale.audio/develop/swagger/schema.yml -o src/generated/types.ts", + "fmt": "yarn lint --fix", + "fmt:html": "node --experimental-strip-types node_modules/prettier/bin/prettier.cjs index.html public/embed.html --write" }, "dependencies": { "@sentry/tracing": "7.47.0", @@ -135,9 +137,27 @@ "bracketSpacing": true, "embeddedLanguageFormatting": "off", "htmlWhitespaceSensitivity": "strict", + "printWidth": 160, + "semi": false, "singleAttributePerLine": true, - "trailingComma": "es5", + "singleQuote": true, + "trailingComma": "none", "tabWidth": 2, - "useTabs": false + "useTabs": false, + "overrides": [ + { + "files": "*.html", + "options": { + "singleAttributePerLine": false + } + }, + { + "files": "*.json", + "options": { + "parser": "json", + "printWidth": 80 + } + } + ] } }