Skip to content

chore: update code style configuration with Prettier and ESLint integration#49

Merged
sonmessia merged 1 commit intomainfrom
chore/setup-code-style
Dec 7, 2025
Merged

chore: update code style configuration with Prettier and ESLint integration#49
sonmessia merged 1 commit intomainfrom
chore/setup-code-style

Conversation

@sonmessia
Copy link
Copy Markdown
Owner

@sonmessia sonmessia commented Dec 7, 2025

Proposed changes

Update code style configuration
Types of changes

  • 🐛 Bug fix (non-breaking change which fixes an issue)

  • ✨ Feature (non-breaking change which adds functionality)

  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)

  • 📝 Docs (documentation only changes)

  • ♻️ Refactor (code improvement without changing functionality)

Checklist

  • Docker build successful (src/backend)

  • All tests passing (pytest)

  • Code follows project standards (Black, Ruff, MyPy)

  • Service boundaries maintained

  • .env.example updated (if environment variables changed)

  • No debug print statements left

Copilot AI review requested due to automatic review settings December 7, 2025 10:17
@sonmessia sonmessia merged commit 9494148 into main Dec 7, 2025
5 of 6 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds Prettier code formatting tooling and integrates it with ESLint to establish consistent code style across the frontend and documentation packages. It also removes invalid comment syntax from JSON files (package.json and package-lock.json), which don't support comments according to the JSON specification.

Key changes:

  • Adds Prettier v3.7.4 and eslint-config-prettier v10.1.8 as dev dependencies to frontend and docs
  • Creates .prettierrc configuration files with formatting rules (semicolons disabled, single quotes, tab width 2, etc.)
  • Adds format npm scripts for running Prettier
  • Integrates eslint-config-prettier into ESLint configuration to prevent rule conflicts
  • Removes copyright comment headers from JSON files

Reviewed changes

Copilot reviewed 5 out of 7 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/frontend/package.json Adds Prettier and eslint-config-prettier dependencies; adds format script; removes invalid JSON comments
src/frontend/package-lock.json Updates lockfile with new Prettier and eslint-config-prettier packages; removes invalid JSON comments
src/frontend/eslint.config.js Imports and applies eslint-config-prettier to disable conflicting ESLint rules
src/frontend/.prettierrc Creates Prettier configuration with code style rules (no semicolons, single quotes, 100 char line width)
docs/package.json Adds Prettier dependency and format script; removes invalid JSON comments
docs/package-lock.json Updates lockfile with Prettier package; removes invalid JSON comments
docs/.prettierrc Creates Prettier configuration with additional markdown-specific overrides for prose wrapping
Files not reviewed (2)
  • docs/package-lock.json: Language not supported
  • src/frontend/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

"write-heading-ids": "docusaurus write-heading-ids",
"typecheck": "tsc"
"typecheck": "tsc",
"format": "prettier --write ."
Copy link

Copilot AI Dec 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The format script runs prettier --write . without a .prettierignore file, which will attempt to format all files including package-lock.json, build artifacts, and other generated files that shouldn't be formatted.

Consider adding a .prettierignore file with common exclusions:

node_modules
dist
build
.docusaurus
package-lock.json
*.min.js
*.min.css
coverage

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,9 @@
{
"semi": false,
"singleQuote": true,
Copy link

Copilot AI Dec 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Prettier configuration sets "singleQuote": true, but the existing codebase uses double quotes consistently for strings and imports (e.g., import { StrictMode } from "react";). When Prettier runs, it will reformat all files to use single quotes, causing widespread changes across the codebase.

Consider changing this to "singleQuote": false to match the existing code style, or run Prettier on the entire codebase in this PR to complete the style migration.

Suggested change
"singleQuote": true,
"singleQuote": false,

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,17 @@
{
"semi": false,
"singleQuote": true,
Copy link

Copilot AI Dec 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Prettier configuration sets "singleQuote": true, but the existing codebase uses double quotes consistently. When Prettier runs, it will reformat documentation and code files to use single quotes.

Consider changing this to "singleQuote": false to match the existing code style, or run Prettier on the entire codebase in this PR to complete the style migration.

Suggested change
"singleQuote": true,
"singleQuote": false,

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,9 @@
{
"semi": false,
Copy link

Copilot AI Dec 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Prettier configuration sets "semi": false, but the existing codebase uses semicolons consistently at the end of statements. When Prettier runs, it will remove all semicolons from files, causing widespread changes.

Consider changing this to "semi": true to match the existing code style, or run Prettier on the entire codebase in this PR to complete the style migration.

Suggested change
"semi": false,
"semi": true,

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,17 @@
{
"semi": false,
Copy link

Copilot AI Dec 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Prettier configuration sets "semi": false, but the existing codebase uses semicolons consistently. When Prettier runs, it will remove semicolons from files.

Consider changing this to "semi": true to match the existing code style, or run Prettier on the entire codebase in this PR to complete the style migration.

Suggested change
"semi": false,
"semi": true,

Copilot uses AI. Check for mistakes.
"lint": "eslint .",
"preview": "vite preview"
"preview": "vite preview",
"format": "prettier --write ."
Copy link

Copilot AI Dec 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The format script runs prettier --write . without a .prettierignore file, which will attempt to format all files including package-lock.json, build artifacts, and other generated files that shouldn't be formatted.

Consider adding a .prettierignore file with common exclusions:

node_modules
dist
build
.docusaurus
package-lock.json
*.min.js
*.min.css
coverage

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants