-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
chore: enforce consistent object-shorthand #7851
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: enforce consistent object-shorthand #7851
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
Pull Request Overview
This PR enforces the ESLint object-shorthand
rule across the site codebase and updates the import of importX
to use its flatConfigs
API.
- Converted all object literals to use explicit
key: value
form (to satisfy the new rule configuration). - Updated
eslint-plugin-import-x
import to pull inflatConfigs
correctly. - Cleaned up related warnings in various reducers, components, and generators.
Reviewed Changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
apps/site/reducers/releaseReducer.ts | Expanded dispatch payload shorthand to explicit props |
apps/site/next.rewrites.mjs | Converted shorthand destination to destination: destination |
apps/site/next.mdx.use.mjs | Updated component mapping to explicit shorthand form |
apps/site/next.dynamic.mjs | Converted route mapping shorthand to full props |
apps/site/next.calendar.mjs | Converted URLSearchParams shorthand to explicit props |
apps/site/next-data/generators/websiteFeeds.mjs | Expanded date shorthand to date: date |
apps/site/next-data/generators/releaseData.mjs | Removed redundant fetch: key, expanded other shorthands |
apps/site/next-data/generators/blogData.mjs | Converted blog metadata shorthand to full object fields |
apps/site/next-data/generators/tests/websiteFeeds.test.mjs | Updated test object shorthand for date property |
apps/site/layouts/Blog.tsx | Converted return shorthand to explicit field: field |
apps/site/i18n.tsx | Expanded locale shorthand to locale: locale |
apps/site/hooks/react-generic/useSiteNavigation.ts | Converted navigation mapping shorthand to full props |
apps/site/eslint.config.js | Updated import of importX to flatConfigs |
apps/site/components/withNavBar.tsx | Converted prop shorthand to link: link , target: target |
apps/site/components/withFooter.tsx | Expanded navigation object shorthand |
apps/site/components/withBreadcrumbs.tsx | Converted breadcrumbs mapping to full props |
apps/site/components/withAvatarGroup.tsx | Converted avatar group props shorthand |
apps/site/app/[locale]/page.tsx | Expanded sharedContext shorthands |
apps/site/app/[locale]/next-data/page-data/route.ts | Renamed deflatedSource to content and expanded shorthand |
apps/site/app/[locale]/next-data/api-data/route.ts | Expanded shorthand filename |
Comments suppressed due to low confidence (1)
apps/site/next.mdx.use.mjs:15
- [nitpick] Good use of shorthand here; ensure consistency across similar mappings.
DownloadReleasesTable,
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## main #7851 +/- ##
==========================================
+ Coverage 73.64% 73.72% +0.08%
==========================================
Files 96 96
Lines 8354 8365 +11
Branches 220 219 -1
==========================================
+ Hits 6152 6167 +15
+ Misses 2201 2197 -4
Partials 1 1 ☔ View full report in Codecov by Sentry. |
Lighthouse Results
|
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.
I'm in favor of this change, overall. just needs rebasing
Description
We intend to add this as a rule based on the feedback received during code reviews, so it applies consistently across the website for all contributors and helps maintain the code style.
See; (https://eslint.org/docs/latest/rules/object-shorthand)
Additionally, cleaned up the
importX
imports that were given warnings in the project