diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 244a0db9777e3d5..5ec79f53704398a 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 8187e003b0cd1f8..78238a7c5b3f1d1 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 72e602748875a63..c4c1aea6ce182c1 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",