Conversation
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:
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:
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. |
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.
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:
.prettierrcconfiguration file.prettierignorefileRan 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:
Resolution:
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-linecomments no longer aligned with the correct lines due to formatting changes.Resolution:
Result
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:
.prettierrc,.prettierignore).If approved, this will establish Prettier as the standard static formatting tool for the project going forward.