-
-
Notifications
You must be signed in to change notification settings - Fork 899
fix: ERROR FIX eslint IN REFRESHTOKEN #3914
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
fix: ERROR FIX eslint IN REFRESHTOKEN #3914
Conversation
WalkthroughThis pull request refines the code base through various improvements. The CSS files have been reformatted for improved readability and styling, including adjustments to font-family declarations and accordion transitions. The dependency management in Changes
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 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
|
Our Pull Request Approval ProcessThanks for contributing! Testing Your CodeRemember, your PRs won't be reviewed until these criteria are met:
Our policies make our code better. ReviewersDo not assign reviewers. Our Queue Monitors will review your PR and assign them.
Reviewing Your CodeYour reviewer(s) will have the following roles:
CONTRIBUTING.mdRead our CONTRIBUTING.md file. Most importantly:
Other
|
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.
Congratulations on making your first PR! 🎊 If you haven't already, check out our Contributing Guidelines and PR Reporting Guidelines to ensure that you are following our guidelines for contributing and creating PR.
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: 3
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.json
is excluded by!**/package-lock.json
📒 Files selected for processing (5)
docs/src/css/custom.css
(1 hunks)package.json
(4 hunks)src/assets/css/app.css
(4 hunks)src/components/CheckIn/TableRow.tsx
(1 hunks)src/utils/getRefreshToken.spec.ts
(1 hunks)
👮 Files not reviewed due to content moderation or server errors (1)
- src/assets/css/app.css
🧰 Additional context used
🪛 GitHub Actions: PR Workflow
src/components/CheckIn/TableRow.tsx
[error] 1-1: File contains code coverage disable statement. Please remove it and add the appropriate tests.
package.json
[error] 1-1: Unauthorized change/delete detected for file 'package.json'.
🔇 Additional comments (6)
docs/src/css/custom.css (1)
42-48
: Improved CSS variable formatting for better readability.The multiline formatting of font family declarations makes the CSS more readable while maintaining the same functionality.
src/utils/getRefreshToken.spec.ts (1)
34-37
: Improved window.location mock implementation.Using
Object.defineProperty
withwritable: true
is a better approach than direct assignment for mocking the location object in tests. This ensures the property can be properly modified during tests while maintaining its attributes.package.json (4)
118-120
: New TSDoc-related dependencies added.The addition of
@microsoft/tsdoc
and@microsoft/tsdoc-config
dependencies supports the eslint-plugin-tsdoc upgrade mentioned in the PR objectives.The new
@testing-library/dom
package will enhance DOM testing capabilities.
140-141
: Updated testing dependencies.The vitest coverage package has been updated to version 3.1.1, which should be compatible with the main vitest version also being updated.
149-150
: Upgraded eslint-plugin-tsdoc to v0.4.0.This is the primary objective of the PR and should help resolve TSDoc syntax issues.
160-164
:❓ Verification inconclusive
New documentation packages and updated Vitest.
The TypeDoc packages will enhance documentation generation capabilities, and Vitest has been updated to version 3.1.1.
🌐 Web query:
What are the breaking changes between Vitest 2.x and 3.x?
💡 Result:
Vitest 3.x introduced several breaking changes from 2.x that developers should be aware of:
Configuration Changes
- Browser configuration:
browser.name
andbrowser.providerOptions
were deprecated. Usebrowser.instances
to define multiple browser setups in a single configuration [4][10].- Coverage: Test files are now always excluded from coverage reports, even if
coverage.excludes
is overwritten [4].- Vite 6 integration: The
module
conditional export is no longer resolved by default due to Vite 6 changes [4][3].API and Behavior Changes
- Mock behavior:
spy.mockReset()
now restores the original implementation instead of a no-op [4].vi.spyOn()
reuses existing mocks rather than creating new ones [4].- Test declarations: Passing an object as the third argument to
test
/describe
triggers warnings (will throw errors in v4):test('test', { retry: 3 }, () => {...}) // Warning ✅ test('test', () => {...}, { retry: 3 }) // Warning ❌- Error comparisons: Stricter checks now include
name
,message
,cause
, and prototype comparisons:expect(new TypeError('msg')).toEqual(new Error('msg')) // Fails ✅Type System Changes
- Deprecated types: The
Custom
type was deprecated. UseRunnerCustomCase
andRunnerTestCase
instead [4].- ImportMetaEnv: Made strictly unavailable in config files unless explicitly defined [3][8].
Environment Requirements
- Node.js: Requires Node 18+ when using browser mode with updated environment packages [3][9].
- Vite 6: Some resolver behaviors changed - test files using
module
conditionals may need adjustments [4].Developers should consult the official migration guide for detailed upgrade instructions and validation steps [4][10]. While most projects won't be affected, teams using advanced mocking or custom reporters should pay special attention to API changes.
Citations:
- 1: https://github.com/vitest-dev/vitest/releases
- 2: https://www.speakeasy.com/post/vitest-vs-jest
- 3: https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md
- 4: https://vitest.dev/guide/migration.html
- 5: https://dev.to/jacobandrewsky/testing-vue-components-with-vitest-5c21
- 6: https://dev.to/mbarzeev/from-jest-to-vitest-migration-and-benchmark-23pl
- 7: https://vitest.dev/guide/features
- 8: https://vitest.dev/config/
- 9: https://mswjs.io/docs/migrations/1.x-to-2.x/
- 10: https://vitest.dev/blog/vitest-3
Action: Verify Vitest 3.x Breaking Changes and Test Configurations
The updated
package.json
now includes new documentation packages ("typedoc" and "typedoc-plugin-markdown") and updates Vitest to version 3.1.1. Note that Vitest 3.x introduces several breaking changes versus 2.x—such as adjustments in configuration (e.g., browser settings and coverage exclusions), modifications to mock behavior, and stricter error comparisons. Please ensure that:
- Test Configurations: All test setups (including any browser or coverage configurations) are compatible with Vitest 3.x.
- Mock & API Changes: Any custom mocks and test behaviors are reviewed in light of the updated API changes.
- Migration Verification: The official Vitest migration guide is consulted to address potential impacts on your test suite.
If your test suite passes and these points have been validated, the new dependency updates appear safe to merge.
const blob = new Blob([new Uint8Array(pdf.buffer)], { | ||
type: 'application/pdf', |
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.
Enhanced Blob construction with explicit Uint8Array.
Wrapping the buffer in a Uint8Array
before creating the Blob improves type safety and compatibility when handling binary data.
However, there's a code coverage disable statement (istanbul ignore next
) that should be removed according to the pipeline error. You should add appropriate tests instead of disabling code coverage.
"vite": "^6.2.4", | ||
"vite-plugin-environment": "^1.1.3", | ||
"vite-plugin-node-polyfills": "^0.22.0", | ||
"vite-plugin-node-polyfills": "^0.23.0", |
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.
Package updates for Vite and related plugins.
The updates to Vite (to v6.2.4) and vite-plugin-node-polyfills are significant version jumps that might introduce breaking changes.
There's a pipeline error indicating unauthorized changes to package.json. Please make sure these updates are properly approved and follow the project's dependency management policies.
#!/bin/bash
# Checking Vite v6 compatibility with current setup
grep -r "import.meta" --include="*.ts" --include="*.tsx" .
"jest-preview": "^0.2.3", | ||
"lint-staged": "^15.3.0", |
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.
Downgraded jest-preview.
The change from version 0.3.1 to 0.2.3 appears to be a downgrade rather than an upgrade.
Verify if this downgrade is intentional and necessary for compatibility with other packages.
What kind of change does this PR introduce?
Upgrade package eslint-plugin-tsdoc from 0.3.0 to 0.4.0
Issue Number:
Fixes #3911
Summary
The Talawa-Admin setup has multiple issues, including outdated dependencies (e.g., [email protected], [email protected]), peer conflicts ([email protected] vs [email protected]), and security vulnerabilities (14 reported by npm audit). ESLint errors include missing return types, unused variables, and incorrect TSDoc syntax. Prettier issues involve missing commas and blank lines. To fix this, upgrade dependencies, resolve peer conflicts, run npm audit fix, apply prettier and eslint --fix, and validate TSDoc comments.
Summary by CodeRabbit