-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
USWDS-Site - Prettier should run on .md files. #3037
Open
cathybaptista
wants to merge
14
commits into
main
Choose a base branch
from
cb-enable-prettier-on-markdown
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+13
−7
Conversation
This file contains 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
Doesn't require a build
…rt of gems are excluded from prettier.
cathybaptista
force-pushed
the
cb-enable-prettier-on-markdown
branch
from
January 31, 2025 15:45
3a82e12
to
89e0ace
Compare
cathybaptista
changed the title
cb: updating circleci and package.json to allow CI of md files.
USWDS-Site - Prettier should run on .md files.
Jan 31, 2025
cathybaptista
force-pushed
the
cb-enable-prettier-on-markdown
branch
from
January 31, 2025 19:26
e429e0f
to
89e0ace
Compare
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.
Summary
We were ignoring running prettier on markdown files. This can cause inconsistencies and errors when writing MD/Frontmatter.
Example: 1c6453d
Related issue
Note comment:
#2868 (comment)
These are links to these files, there weren't any problems running prettier
pages/design-principles/overview.md (before)
pages/design-principles/overview.md (after)
https://github.com/uswds/uswds-site/blob/main/pages/documentation/maturity-model.md (before)
https://github.com/uswds/uswds-site/blob/cb-enable-prettier-on-markdown/pages/documentation/maturity-model.md (after)
Closes #2868
Problem statement
By not running prettier against .md files (in .prettierignore), we are not ensuring these files are subject to coding standards and proper formatting.
Solution
Fix issues.
Major changes
Added new script to config.yml:
name: Check formatting
command: npm run prettier:check
Prettier check in package.json now checks .md files
lint in package.json runs "npx gulp lintJS lintSass && npm run prettier",
run prettier runs both prettier:md && prettier:scss
Do not run prettier on the vendor directory since we don't manage those md files.
Pipeline before running prettier:
Pipeline after running prettier:
Testing and review