Conversation
✅ Deploy Preview for project-idea-board ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
This PR introduces a Prettier-based formatting setup (based on cell-catalog) and applies it across the TypeScript/TSX code to standardize code style as part of issue #51 (dev housekeeping).
Changes:
- Added a
.prettierrc.jsonusing@trivago/prettier-plugin-sort-importsand configured import ordering. - Updated
package.jsonto use Prettier v3 and addedformat/formatCheckscripts. - Ran formatting across TS/TSX files, including import ordering and minor whitespace/layout changes.
Reviewed changes
Copilot reviewed 19 out of 20 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Lockfile updates reflecting Prettier/plugin dependency additions. |
| package.json | Adds Prettier v3 + import-sorting plugin and new formatting scripts. |
| .prettierrc.json | Introduces Prettier configuration and import sorting rules. |
| src/types/index.ts | Prettier formatting for type exports. |
| src/templates/tags.tsx | Import spacing + GraphQL query formatting. |
| src/templates/program.tsx | Import ordering consistent with new config. |
| src/templates/index-page.tsx | Import ordering/grouping adjusted. |
| src/templates/idea-post.tsx | Import ordering + JSX formatting adjustments. |
| src/templates/dataset.tsx | Import spacing adjustments. |
| src/templates/allenite.tsx | Import ordering consistent with new config. |
| src/templates/about-page.tsx | Import grouping/order adjusted. |
| src/pages/ideas/index.tsx | Import ordering + indentation cleanup. |
| src/components/TagPopover.tsx | Import order + trailing comma formatting. |
| src/components/SiteMetadata.tsx | Prettier formatting of useStaticQuery(graphql\...`)` call. |
| src/components/PreviewCompatibleImage.tsx | Import spacing adjustments. |
| src/components/MaterialsAndMethods.tsx | Import spacing + trailing comma formatting. |
| src/components/Layout.tsx | Import ordering/grouping + moved destructuring to match formatting. |
| src/components/IdeaRoll.tsx | Import ordering + object/JSX formatting adjustments. |
| src/components/IconText.tsx | Import spacing + alignment cleanup. |
| src/components/FullWidthImage.tsx | Import spacing adjustments. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -62,7 +64,7 @@ | |||
| "gatsby-plugin-postcss": "^6.13.1", | |||
| "netlify-cli": "^17.15.7", | |||
| "postcss": "^8.4.35", | |||
| "prettier": "^2.0.5", | |||
| "prettier": "^3.8.1", | |||
| "typescript": "^5.3.3", | |||
There was a problem hiding this comment.
prettier was bumped to ^3.8.1 (and a new plugin added) but package-lock.json still pins Prettier 2.8.8. If installs/CI use npm (e.g., npm ci), this will cause dependency drift or failures. Please update package-lock.json accordingly or remove it if the project is intended to be Yarn-only, so the repo has a single source of truth for dependency resolution.
package.json
Outdated
| "format": "prettier \"src/**/*.{tsx,ts}\" --write", | ||
| "formatCheck": "prettier \"src/**/*.{tsx,ts}\" --check", |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
There was a problem hiding this comment.
did this by expanding the glob with a bit more precision
jessicasyu
left a comment
There was a problem hiding this comment.
Do you need to run prettier manually each time? Or can it be attached to a pre commit hook or something?
| @@ -0,0 +1,8 @@ | |||
| { | |||
| "plugins": ["@trivago/prettier-plugin-sort-imports"], | |||
| "printWidth": 80, | |||
There was a problem hiding this comment.
Assuming this is configuring line width: is 80 the convention? We've been using 88 or 100, because 80 was a bit too restrictive/short
There was a problem hiding this comment.
Hmm, I'm not sure what is considered standard, It's 80 in cell-catalog. I'm looking around now and seeing 100 some places (BFF), and 120 in other (vole-app, tfe), so 80 does seem small.
I might just go ahead with this for now and I'm happy to revisit it later. I do wonder if style/formatting guidelines are a good topic for reusable workflows?
There was a problem hiding this comment.
As for pre-commit hooks we can attach it. POC for that is ongoing in cell-catalog we are trying to get lefthook to work in place of husky as it's friendlier to polyglot repos.
Added prettier config based on cell-catalog, ran it.
Advances #51