Skip to content

Integrate prettier#52

Open
eseudieu wants to merge 5 commits intomainfrom
integrate-prettier
Open

Integrate prettier#52
eseudieu wants to merge 5 commits intomainfrom
integrate-prettier

Conversation

@eseudieu
Copy link
Copy Markdown

Pull Request: Add Prettier and Resolve Formatting/Lint Conflicts

Summary

This pull request introduces Prettier to the repository to standardize code formatting and improve consistency across the codebase. The update includes configuration files, repository-wide formatting, and fixes to ensure compatibility with existing ESLint rules and tests.

Changes

  • Added Prettier to the repository via steps at the static tool's documentation.

  • Created:

    • .prettierrc configuration file
    • .prettierignore file
  • Ran Prettier across the entire repository to normalize formatting. (npx prettier . --write)

Example of prettier output when running npx prettier . --write
prettier-output.txt

Issues Encountered & Resolutions

Quote Formatting Conflicts

Running Prettier initially replaced all single quotes with double quotes, which caused:

  • Lint failures due to conflicts with existing ESLint rules.
  • Test failures where expected outputs relied on single-quoted strings.

Resolution:

  • Updated the Prettier configuration to enforce single quotes.

ESLint and Prettier Conflicts

Attempted to resolve formatting rule conflicts between ESLint and Prettier by following the recommended integration steps outlined in the ESLint/Prettier installation GitHub page.

ESLint Ignore Comment Misalignment

After repository-wide formatting, some eslint-disable-next-line comments no longer aligned with the correct lines due to formatting changes.

Resolution:

  • Updated affected ignore comments so they reference the correct lines.

Result

  • All lint checks pass
  • All tests pass
  • Codebase now has consistent automated formatting via Prettier.

Additional Notes

This PR results in several file updates due to repository-wide formatting changes. Future PRs should be easier to review since formatting will now be handled automatically by Prettier.

How to Review

Recommended review approach:

  1. Review configuration additions (.prettierrc, .prettierignore).
  2. Spot-check representative files for formatting correctness.
  3. Verify lint and test pipeline status.

If approved, this will establish Prettier as the standard static formatting tool for the project going forward.

@eseudieu eseudieu self-assigned this Mar 12, 2026
@eseudieu eseudieu linked an issue Mar 12, 2026 that may be closed by this pull request
@eseudieu
Copy link
Copy Markdown
Author

What is the name and high-level description of what the tool does? Provide a link to its documentation/source.

Prettier is an opinionated code formatter that automatically enforces a consistent style across your codebase.

Is the tool used for static or dynamic analysis?

Static

What types of problems does this particular tool catch?

Prettier handles:

  • Inconsistent formatting (spacing, indentation, line breaks)
  • Style issues (quotes, semicolons, trailing commas)
  • Readability concerns (line wrapping, alignment)
  • Minor syntax ambiguities that can be normalized

What types of customization are possible or necessary?

Prettier is intentionally low-config, but through the config file .prettierrc you can customize: line length, tab width, semicolons, single- or double-quotation marks, trailing commas, file-specific overrides, and more

How can/should this tool be integrated into a development process?

Typical workflow:

  • Developer writes code
  • Prettier auto-formats on save or commit
  • CI ensures formatting compliance

Are there many false positives? False negatives? True positive reports about things you don't care about?

There are as many "false positives/negatives" as the user allows for in the config file as prettier is a rule-based static format-checker.

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.

Integrate Prettier

1 participant