-
Notifications
You must be signed in to change notification settings - Fork 47
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
chore(web): add prettier package to organize imports #1271
Conversation
WalkthroughThe pull request introduces changes to two files: Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
✅ Deploy Preview for reearth-web ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
web/package.json (1)
Line range hint
32-34
: Consider enhancing lint-staged configuration.Currently, lint-staged only runs ESLint. To ensure imports are consistently organized before commits, consider adding prettier to the pre-commit hooks:
"lint-staged": { - "**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx}": "eslint --fix" + "**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx}": [ + "eslint --fix", + "prettier --write" + ] }
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
⛔ Files ignored due to path filters (1)
web/yarn.lock
is excluded by!**/yarn.lock
,!**/*.lock
,!**/*.lock
📒 Files selected for processing (2)
web/.prettierrc
(1 hunks)web/package.json
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- web/.prettierrc
🔇 Additional comments (2)
web/package.json (2)
88-88
: LGTM! Verify editor integration.
The addition of prettier-plugin-organize-imports
as a dev dependency is appropriate. The version range ^4.1.0
is compatible with the existing prettier version 3.3.3
.
Let's verify there are no conflicts with existing import organization tools:
✅ Verification successful
LGTM! No conflicts with existing tooling
The package can be safely added as there are no conflicting import organization tools or configurations in the project. The only related packages found are for sorting UI components (sortablejs
and related packages), which serve a different purpose.
Since there are no existing prettier or eslint configurations managing imports, this addition will provide a clean way to organize imports during development.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check for potential conflicts with other import organization tools
rg -l "importOrder|import.*sort" .eslintrc* .prettierrc*
# Check if the project uses VSCode and has relevant settings
fd -g '.vscode/settings.json' -x cat {} \; | grep -i 'format\|prettier\|import'
Length of output: 457
Script:
#!/bin/bash
# Let's check for config files with any extension
fd -e json -e yaml -e yml -e js -H "eslint|prettier" -x cat {} \; | grep -i "importOrder\|import.*sort\|prettier.*plugin"
# Check for existing import organization tools in package.json
cat web/package.json | grep -i "import\|sort"
# Look for any editor config files
fd -H -e editorconfig -x cat {} \;
Length of output: 360
Line range hint 23-23
: Verify the format script.
The format
script will automatically use the new plugin. Please verify that running yarn format
successfully organizes imports.
Coderabbitai says I made a change to the version to |
Using ESLint import/order |
Overview
Small package that will help organize imports when a file is saved in the editor. It does not scan through all the files but only checks when a single file is open. Might not be needed but helps keep imports in order and one less thing for the developer to think of how to sort.
What I've done
What I haven't done
How I tested
Which point I want you to review particularly
Memo
Summary by CodeRabbit
1.0.0-alpha.8
.prettier-plugin-organize-imports
as a new development dependency.