feat: add Prettier formatter config (#677)#730
Merged
Conversation
4af7b77 to
3a9d5f7
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Prettier to the repo and applies formatting updates to align frontend code and repo templates with the new formatter configuration.
Changes:
- Added Prettier as a dev dependency and updated
.prettierrcoverrides - Reformatted multiple TypeScript/React files to match Prettier output
- Added GitHub issue templates for questions, documentation, and configuration issues
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| package.json | Adds Prettier as a dev dependency to enable formatting tooling |
| frontend/src/services/analytics.ts | Prettier-driven formatting for exported types and trackButtonClick |
| frontend/src/hooks/useAnalytics.ts | Prettier formatting + renames unused callback arg to _event |
| frontend/src/components/ConversionFlow/ConversionFlowManager.tsx | Prettier formatting for destructuring, deps array, and whitespace |
| .prettierrc | Adjusts overrides, removing explicit Python parser setting |
| .github/ISSUE_TEMPLATE/question.md | Adds a “Question” issue template |
| .github/ISSUE_TEMPLATE/documentation.md | Adds a “Documentation” issue template |
| .github/ISSUE_TEMPLATE/config.md | Adds a “Configuration / Environment” issue template |
Comment on lines
18
to
23
| { | ||
| "files": "*.py", | ||
| "options": { | ||
| "parser": "python", | ||
| "tabWidth": 4 | ||
| } | ||
| } |
There was a problem hiding this comment.
Prettier does not format Python files without an appropriate plugin/parser; keeping a *.py override can be confusing and prettier runs over .py files may still fail with 'No parser could be inferred'. Consider either adding a Python Prettier plugin (and the corresponding parser setting) or removing/ignoring *.py from Prettier runs (e.g., via .prettierignore or limiting CLI globs).
- Add .prettierrc with TypeScript, React, and Python config - Configure printWidth 100 for TypeScript, tabWidth 4 for Python - Add prettier to root package.json devDependencies - Fix formatting issues in 3 frontend files - CI pipeline already has format-check job using pnpm format:check
3a9d5f7 to
55e40f3
Compare
Co-authored-by: openhands <openhands@all-hands.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #677