diff --git a/.github/workflows/pr_checks.yml b/.github/workflows/pr_checks.yml index fce779fb4..845b6528e 100644 --- a/.github/workflows/pr_checks.yml +++ b/.github/workflows/pr_checks.yml @@ -46,6 +46,9 @@ jobs: - name: Run linting run: npm run lint + - name: Check code formatting + run: npm run format:check + review: uses: ./.github/workflows/continue-review.yaml secrets: diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 000000000..f7553b3a2 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,40 @@ +# Dependencies +node_modules/ + +# Build output +dist/ + +# Coverage +coverage/ + +# Logs +*.log +logs/ + +# OS files +.DS_Store +Thumbs.db + +# IDE files +.vscode/ +.idea/ +*.swp +*.swo + +# Lock files +package-lock.json +yarn.lock +pnpm-lock.yaml + +# Test files +*.test.ts +*.test.tsx +*.spec.ts +*.spec.tsx + +# Config files that don't need formatting +.prettierrc +.prettierignore + +# Generated files +*.generated.* \ No newline at end of file diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 000000000..354af4b2f --- /dev/null +++ b/.prettierrc @@ -0,0 +1,8 @@ +{ + "tabWidth": 2, + "useTabs": false, + "trailingComma": "all", + "semi": true, + "singleQuote": false, + "bracketSpacing": true +} diff --git a/package.json b/package.json index f8f3bf564..df4d64cb8 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,8 @@ "repomix:cli": "npx repomix --ignore sdk-repomix.xml -o cli-repomix.xml", "lint": "tsc --noEmit && eslint .", "lint:fix": "eslint . --fix", + "format": "prettier --write .", + "format:check": "prettier --check .", "typecheck": "tsc --noEmit", "watch:logs": "tail -f ~/.continue/logs/cn.log", "prepare": "npm run build", @@ -105,6 +107,7 @@ "happy-dom": "^18.0.1", "ink-testing-library": "^4.0.0", "nock": "^14.0.5", + "prettier": "^3.6.2", "semantic-release": "^24.2.7", "supertest": "^7.1.3", "ts-node": "^10.9.2",