Skip to content

Conversation

@Rahul-R79
Copy link

Closes #191

This PR integrates Prettier into the project to handle code formatting, separating stylistic concerns from code quality checks (ESLint). It also adds a mandatory formatting check in the CI pipeline.

Changes

  • Added Dependencies: prettier and eslint-config-prettier.
  • Added Configuration: Created .prettierrc with modern defaults (2-space indentation, single quotes, no trailing whitespace).
  • Updated Scripts: Added npm run format (write) and npm run format:check (verify) to package.json.
  • Updated ESLint: Modified .eslintrc.yml to extend prettier, disabling conflicting formatting rules.
  • Updated CI: Added npm run format:check step to .github/workflows/build.yml to fail builds on formatting errors.
  • Reformatted Codebase: Applied Prettier formatting to all source files (~133 files changed).

Flags

  • Large Diff: This PR touches ~130 files due to whitespace/indentation changes (moving from 4 spaces to 2 spaces).
  • History Mitigation: After merging, we should add the commit hash to .git-blame-ignore-revs (in a follow-up PR) to preserve git blame usability.

Screenshots or Video

N/A (Formatting changes only)

Related Issues

Author Checklist

  • Ensure you provide a DCO sign-off for your commits using the --signoff option of git commit.
  • Vital features and changes captured in unit and/or integration tests
  • Commits messages follow AP format
  • Extend the documentation, if necessary
  • Merging to main from fork:feat/add-prettier

@Rahul-R79
Copy link
Author

Rahul-R79 commented Jan 14, 2026

As we discussed in today's call, I've implemented Prettier for consistent formatting and added a CI check to enforce it.

I’ve also run the tests, linting, and Prettier locally, and everything passed successfully with no issues.

Note: To keep git blame clean, I will open a follow-up PR to add this commit hash to .git-blame-ignore-revs after merging, effectively hiding this massive reformatting from history.

Please review when you get some time @mttrbrts @dselman !

*/
toAvroName(name) {
// $ is unfortunately a restricted character in Avro!
return name.replace('$', '_');

Check failure

Code scanning / CodeQL

Incomplete string escaping or encoding

This replaces only the first occurrence of '$'.
*/
toGraphQLName(name) {
// $ is unfortunately a restricted character in GraphQL!
return name.replace('$', '_').replace(/\./g, '_');

Check failure

Code scanning / CodeQL

Incomplete string escaping or encoding

This replaces only the first occurrence of '$'.
* @returns {string} a valid XSD NCName
*/
toXsName(name) {
return name.replace('$', '_');

Check failure

Code scanning / CodeQL

Incomplete string escaping or encoding

This replaces only the first occurrence of '$'.
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.

feat: Integrate Prettier for Code Formatting and CI Check

1 participant