Skip to content

Add prettier configuration and a format check step in ci - #574

Open
Johnsource-hub wants to merge 5 commits into
scout-off:mainfrom
Johnsource-hub:Add-Prettier-configuration-and-a-format-check-step-in-CI
Open

Add prettier configuration and a format check step in ci#574
Johnsource-hub wants to merge 5 commits into
scout-off:mainfrom
Johnsource-hub:Add-Prettier-configuration-and-a-format-check-step-in-CI

Conversation

@Johnsource-hub

Copy link
Copy Markdown

#closes
#545
Summary of Changes
Created Prettier Configuration files:

.prettierrc.json: Matching existing codebase styles (single quotes, semicolons enabled, 2-space tab width, es5 trailing commas, print width of 100, and lf line endings).
.prettierignore: Excluding standard built outputs and databases (node_modules/, dist/, *.db, etc.).
Added Dev Dependencies:

Installed prettier and eslint-config-prettier to ensure formatting works seamlessly and ESLint rules do not conflict.
Installed eslint@8, @typescript-eslint/parser@7, and @typescript-eslint/eslint-plugin@7 to solve the missing local dependencies that previously prevented ESLint from running locally.
Resolved ESLint Parser Scope:

Created tsconfig.eslint.json extending tsconfig.json to include tests/ in the compilation scope for ESLint, ensuring typescript-eslint doesn't fail on testing files.
Configured .eslintrc.cjs to use tsconfig.eslint.json and extend prettier to prevent stylistic conflicts.
Added NPM Scripts & CI Workflow Step:

Added format:check (prettier --check .) and format (prettier --write .) scripts to package.json.
Added a Check formatting step (npm run format:check) in .github/workflows/ci.yml to fail the build on pull requests or commits with unformatted files.
Reformatted Entire Codebase:

Formatted the repository repo-wide using npm run format so that the formatting baseline is clean.
Ran npm run format:check and verified that formatting checks pass cleanly with exit code 0.

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.

1 participant