From aceec1cf6bc5b35bbd543eeb7639b6e6833da4d9 Mon Sep 17 00:00:00 2001 From: James Ross Date: Fri, 15 Nov 2024 19:23:49 +0000 Subject: [PATCH] [Docs Site] core formatting checks (#17262) * chore: core formatting checks * chore: format left-over files * chore: more formatting * chore: more formatting * chore: format more * chore: format more * chore: format * chore: update formatting * Update package.json Co-authored-by: Kian --------- Co-authored-by: Kian --- .github/workflows/ci.yml | 4 ++-- .prettierignore | 2 +- package.json | 6 +++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 244a0db9777e3d..5ec79f53704398 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,8 +30,8 @@ jobs: - run: npm ci - run: npm run check - ## TODO: formatting checks - + - run: npm run format:core:check + ## TODO: content formatting checks - run: npm run build env: NODE_OPTIONS: "--max-old-space-size=4192" diff --git a/.prettierignore b/.prettierignore index 8187e003b0cd1f..78238a7c5b3f1d 100644 --- a/.prettierignore +++ b/.prettierignore @@ -5,4 +5,4 @@ dist public/_redirects public/analytics/static/downloads/main.css src/content/workers-ai-models/*.json -tests/fixtures/openapi.json \ No newline at end of file +tests/fixtures/openapi.json diff --git a/package.json b/package.json index 72e602748875a6..c4c1aea6ce182c 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,11 @@ "check:functions": "npx tsc --noEmit -p ./functions/tsconfig.json", "check:worker": "npx tsc --noEmit -p ./worker/tsconfig.json", "dev": "npx astro dev", - "format": "npx prettier --write \"**/*.{js,jsx,ts,tsx,mjs,astro,css,json,yaml,yml}\"", + "format": "npm run format:core && npm run format:data", + "format:core": "npx prettier --write \"**/*.{js,jsx,ts,tsx,mjs,css}\"", + "format:core:check": "npm run format:core -- --check", + "format:content": "npx prettier --write \"**/*.{md,mdx,astro}\"", + "format:data": "npx prettier --write \"**/*.{json,yaml,yml}\"", "postinstall": "npx patch-package && npm run sync", "preview": "npx astro preview", "script:optimize-svgs": "npx tsx scripts/optimize-svgs.ts",