Skip to content
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

Upgrade to Eslint v9 #10102

Merged

Conversation

AdityaJ2305
Copy link
Contributor

@AdityaJ2305 AdityaJ2305 commented Jan 22, 2025

Proposed Changes

@ohcnetwork/care-fe-code-reviewers

Merge Checklist

  • Add specs that demonstrate bug / test a new feature.
  • Update product documentation.
  • Ensure that UI text is kept in I18n files.
  • Prep screenshot or demo video for changelog entry, and attach it to issue.
  • Request for Peer Reviews
  • Completion of QA

Summary by CodeRabbit

Here are the updated release notes based on the provided summary:

  • Linting and Configuration

    • Updated ESLint configuration to the latest version
    • Upgraded TypeScript and ESLint plugin dependencies
    • Removed MDX-specific linting plugin
  • UI and Component Improvements

    • Added display names to various components for better debugging
    • Enhanced key management in list rendering for improved performance
    • Refined error handling in multiple components
  • Type and Interface Updates

    • Simplified type declarations in several components
    • Removed some unused type definitions
  • Microphone and Permission Handling

    • Improved microphone access tracking in recording utilities
    • Enhanced permission checking in audio-related components
  • Validation and Form Handling

    • Corrected phone number validation logic
    • Improved optional callback handling in form components
  • New Features

    • Added EmergencyContact component to Demography details

These changes focus on code quality, performance optimization, and minor functional improvements across the project.

@AdityaJ2305 AdityaJ2305 requested a review from a team as a code owner January 22, 2025 16:12
Copy link
Contributor

coderabbitai bot commented Jan 22, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This pull request introduces a comprehensive upgrade of the ESLint configuration from version 8 to version 9, involving significant changes to the project's linting setup. The modifications include replacing the legacy .eslintrc.json with a new eslint.config.mjs, updating dependencies, and making minor adjustments across various components to improve code consistency and clarity. The changes aim to modernize the project's code quality tooling while maintaining existing functionality.

Changes

File Change Summary
.eslintrc.json Deleted legacy ESLint configuration file
eslint.config.mjs New ESLint configuration file with comprehensive plugin and rule settings
package.json Updated ESLint-related dependencies, added new packages, removed eslint-plugin-mdx
Multiple components Minor refactoring of error handling, adding displayName, and improving key assignments in lists

Assessment against linked issues

Objective Addressed Explanation
Upgrade eslint to v9
Ensure plugin compatibility
Update eslint config

Possibly related PRs

  • Improve code splitting #8979: The main PR involves changes to ESLint configuration, which relates to the introduction of a new ESLint plugin and rules in the retrieved PR that also focuses on linting improvements.
  • Update dependencies #9049: The updates to the package.json in the main PR include ESLint-related dependencies, which aligns with the changes in the retrieved PR that also updates dependencies related to ESLint.
  • Feat: Disallow Relative import #10009: The main PR's changes to ESLint configuration and rules are related to the retrieved PR that also focuses on enhancing linting capabilities.

Suggested labels

needs testing

Suggested reviewers

  • rithviknishad
  • Jacobjeevan
  • khavinshankar

Poem

🐰 Linting Leap of Faith 🚀
From version eight to nine we soar,
ESLint config opens a new door
Plugins dance, rules align just right
Code quality shines, oh so bright!
Hop, hop, hooray! 🎉


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3ab5c3b and fe1c7a7.

📒 Files selected for processing (10)
  • src/CAREUI/interactive/SlideOver.tsx (1 hunks)
  • src/Utils/pubsubContext.tsx (2 hunks)
  • src/Utils/useSegmentedRecorder.ts (2 hunks)
  • src/components/Common/ExcelFIleDragAndDrop.tsx (4 hunks)
  • src/components/Files/AudioCaptureDialog.tsx (1 hunks)
  • src/components/ui/sidebar.tsx (3 hunks)
  • src/hooks/useFileManager.tsx (3 hunks)
  • src/hooks/useFileUpload.tsx (3 hunks)
  • src/hooks/useToast.ts (1 hunks)
  • src/pages/Appointments/BookAppointment.tsx (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

netlify bot commented Jan 22, 2025

Deploy Preview for care-ohc ready!

Name Link
🔨 Latest commit fe1c7a7
🔍 Latest deploy log https://app.netlify.com/sites/care-ohc/deploys/679492b55b049b0008689720
😎 Deploy Preview https://deploy-preview-10102--care-ohc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions github-actions bot added the Deploy-Failed Deplyment is not showing preview label Jan 22, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

🔭 Outside diff range comments (1)
src/Utils/useSegmentedRecorder.ts (1)

Line range hint 15-52: Add cleanup for event listeners in useEffect.

The first useEffect should clean up event listeners and stop the recorder when the component unmounts.

   useEffect(() => {
     if (!isRecording && recorder && audioBlobs.length > 0) {
       setRecorder(null);
     }
+    return () => {
+      if (recorder) {
+        recorder.stream?.getTracks()?.forEach((i) => i?.stop());
+        if (recorder.state === "recording") {
+          recorder.stop();
+        }
+      }
+    };
   }, [isRecording, recorder, audioBlobs]);
🧹 Nitpick comments (3)
eslint.config.mjs (3)

58-60: Update ECMAVersion to latest.

The ecmaVersion is set to 12 (ES2021). Consider updating to the latest version (14/ES2023) to support newer JavaScript features.

-      ecmaVersion: 12,
+      ecmaVersion: 14,

75-88: Consider adding stricter TypeScript rules.

The current TypeScript configuration could be enhanced with additional strict rules for better type safety.

Add these rules to strengthen type checking:

       "@typescript-eslint/no-explicit-any": "warn",
+      "@typescript-eslint/strict-boolean-expressions": "error",
+      "@typescript-eslint/no-non-null-assertion": "error",
+      "@typescript-eslint/explicit-function-return-type": ["error", {
+        "allowExpressions": true,
+        "allowTypedFunctionExpressions": true
+      }],

106-112: Enhance import path rules configuration.

The current import path configuration could be more specific about the base directory structure.

Consider adding these options for better import control:

       "no-relative-import-paths/no-relative-import-paths": [
         "error",
         {
           allowSameFolder: true,
           prefix: "@",
+          rootDir: "src",
+          ignorePatterns: ["**/tests/**", "**/__tests__/**"]
         },
       ],
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 39caada and 90372d6.

📒 Files selected for processing (16)
  • .eslintrc.json (0 hunks)
  • eslint.config.mjs (1 hunks)
  • package.json (2 hunks)
  • src/CAREUI/interactive/SlideOver.tsx (1 hunks)
  • src/Locale/update_locale.js (1 hunks)
  • src/Utils/useSegmentedRecorder.ts (2 hunks)
  • src/components/Common/DateInputV2.tsx (1 hunks)
  • src/components/Common/ExcelFIleDragAndDrop.tsx (3 hunks)
  • src/components/Common/UpdatableApp.tsx (1 hunks)
  • src/components/Files/AudioCaptureDialog.tsx (1 hunks)
  • src/components/Resource/ResourceCreate.tsx (1 hunks)
  • src/components/ui/textarea.tsx (1 hunks)
  • src/hooks/useFileManager.tsx (3 hunks)
  • src/hooks/useFileUpload.tsx (3 hunks)
  • src/hooks/useToast.ts (2 hunks)
  • src/pages/Appointments/BookAppointment.tsx (1 hunks)
💤 Files with no reviewable changes (1)
  • .eslintrc.json
✅ Files skipped from review due to trivial changes (4)
  • src/components/Common/DateInputV2.tsx
  • src/Locale/update_locale.js
  • src/pages/Appointments/BookAppointment.tsx
  • src/hooks/useToast.ts
🧰 Additional context used
🪛 GitHub Actions: Deploy Care Fe
package.json

[error] Dependency conflict: [email protected] is incompatible with @eslint/compat@^1.2.5 which requires eslint@^9.10.0

🔇 Additional comments (14)
src/components/ui/textarea.tsx (1)

5-19: LGTM! Clean type definition improvement.

The change simplifies the component's type system by directly using React's built-in TextareaHTMLAttributes type instead of a separate interface, while maintaining type safety.

src/CAREUI/interactive/SlideOver.tsx (1)

119-119: LGTM! Improved callback safety.

The explicit check for onCloseClick existence before invocation is a good practice that aligns with stricter ESLint rules.

src/components/Common/UpdatableApp.tsx (1)

1-1: Verify the necessity of the ESLint directive.

The ESLint directive to disable @typescript-eslint/no-unused-expressions has been added. This rule is typically needed when using the logical AND operator for side effects, but the code doesn't show any such usage.

✅ Verification successful

ESLint directive is correctly used for React conditional patterns

The directive is necessary as the file uses logical AND operators for React's conditional rendering and dynamic class names, which would trigger the @typescript-eslint/no-unused-expressions rule.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for logical AND operators used for side effects
rg -A 2 "&&\s*[^&]" src/components/Common/UpdatableApp.tsx

Length of output: 320

src/components/Files/AudioCaptureDialog.tsx (2)

91-91: LGTM! Improved error handling clarity.

Good practice using _error to explicitly indicate the error parameter is intentionally unused.


96-96: LGTM! Enhanced conditional check readability.

The explicit if (show) condition improves code clarity compared to using the logical AND operator.

src/components/Common/ExcelFIleDragAndDrop.tsx (1)

50-50: LGTM! Consistent improvement in conditional checks.

The changes from logical AND operators to explicit if statements improve code clarity and maintainability. This pattern is consistently applied across the file.

Also applies to: 99-99, 200-200

src/hooks/useFileUpload.tsx (4)

43-46: LGTM! Type definition improvement.

Converting from interface to type is appropriate here as this is a simple type composition using intersection types.


178-180: LGTM! Improved callback handling.

The explicit check for onUpload callback existence improves code safety and readability.


281-281: LGTM! Consistent error handling pattern.

Using _error for unused error parameter maintains consistency with the error handling pattern seen in other files.


Line range hint 1-1: Overall PR Assessment: High Quality Changes

The changes demonstrate a systematic approach to improving code quality through:

  1. Consistent error handling patterns
  2. Enhanced type safety
  3. Better conditional check readability
  4. Alignment with ESLint v9 requirements

The modifications are well-structured and maintain consistency across all files.

src/hooks/useFileManager.tsx (3)

170-170: LGTM! Improved callback handling.

The change from short-circuit evaluation to an explicit if condition improves code clarity and aligns with ESLint v9's stricter rules.


220-220: LGTM! Improved callback handling.

Similar to the previous change, using an explicit if condition for the onEdit callback improves code clarity.


510-510: LGTM! Proper error handling.

Renaming the error parameter to '_err' explicitly indicates that the error is intentionally unused in the catch block.

src/components/Resource/ResourceCreate.tsx (1)

88-88: LGTM! Fixed phone number validation logic.

The removal of the negation operator corrects the validation logic, ensuring that phone numbers are properly validated.

src/Utils/useSegmentedRecorder.ts Outdated Show resolved Hide resolved
src/Utils/useSegmentedRecorder.ts Show resolved Hide resolved
package.json Show resolved Hide resolved
@AdityaJ2305
Copy link
Contributor Author

Hey Team, how to fix lock-file errors

@github-actions github-actions bot added needs-triage question Further information is requested labels Jan 22, 2025
@AdityaJ2305
Copy link
Contributor Author

@coderabbitai, how to solve lock-file error causing checks fail ?

Copy link
Contributor

coderabbitai bot commented Jan 23, 2025

Tip

For best results, initiate chat on the files or code changes.

@AdityaJ2305 To resolve the lock-file errors, please try these steps:

  1. Delete the existing lock file and node_modules:
rm package-lock.json
rm -rf node_modules
  1. Clean npm cache:
npm cache clean --force
  1. Regenerate the lock file:
npm install
  1. Commit the new package-lock.json file:
git add package-lock.json
git commit -m "chore: update package-lock.json for ESLint v9 upgrade"

This should resolve the lock file inconsistencies. Let me know if you still face any issues!

(_/)<
(•.•)
(> <)
"Here to help!"

🔗 Analysis chain
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for package manager lock files
ls -la package-lock.json yarn.lock pnpm-lock.yaml 2>/dev/null || echo "No lock files found"

# Check if there's a preferred package manager specified
cat package.json | jq -r '.packageManager // empty'

Length of output: 234

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (3)
eslint.config.mjs (3)

80-80: Remove unnecessary override of the 'no-undef' rule

Disabling the no-undef rule is redundant in TypeScript files, as this rule is already handled by the TypeScript compiler. The @typescript-eslint plugin manages undefined variables, and disabling no-undef can prevent potential conflicts.

Apply this diff to remove the unnecessary rule:

-      "no-undef": "off",

30-30: Update 'ecmaVersion' to the latest version

The ecmaVersion is currently set to 12 (ES2021). Consider updating it to "latest" to ensure compatibility with the most recent ECMAScript features your project may be using.

Apply this diff to update the ECMAScript version:

-      ecmaVersion: 12,
+      ecmaVersion: "latest",

68-74: Add comments to clarify unused variable patterns

The configuration for @typescript-eslint/no-unused-vars uses ignore patterns like "^_" to allow certain unused variables. Adding a comment to explain this convention can improve readability and help other developers understand the rationale.

Consider adding:

       "@typescript-eslint/no-unused-vars": [
         "error",
         {
+          // Ignore variables and arguments prefixed with an underscore
           argsIgnorePattern: "^_",
           varsIgnorePattern: "^_",
           caughtErrorsIgnorePattern: "^_",
         },
       ],
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 070ce2e and 2ce556b.

📒 Files selected for processing (3)
  • eslint.config.mjs (1 hunks)
  • src/components/ui/tooltip.tsx (1 hunks)
  • src/types/facility/facility.ts (0 hunks)
💤 Files with no reviewable changes (1)
  • src/types/facility/facility.ts
✅ Files skipped from review due to trivial changes (1)
  • src/components/ui/tooltip.tsx
🔇 Additional comments (2)
eslint.config.mjs (2)

60-63: Verify the TypeScript parser project configuration

The parserOptions specify a project field pointing to "./tsconfig.json". Ensure that this path is correct and that the tsconfig.json file exists and is properly configured. Incorrect project references can lead to linting errors or degraded performance.


145-145: Ensure the correct path for Cypress TypeScript configuration

The parserOptions.project is set to "./cypress/tsconfig.json" for Cypress files. Verify that this path is accurate and that the tsconfig.json file within the cypress directory is properly configured. This is crucial for correct linting of your Cypress tests.

eslint.config.mjs Show resolved Hide resolved
@github-actions github-actions bot added the merge conflict pull requests with merge conflict label Jan 24, 2025
Copy link

👋 Hi, @AdityaJ2305,
Conflicts have been detected against the base branch. Please rebase your branch against the base branch.


This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

🧹 Nitpick comments (10)
src/components/Patient/symptoms/SymptomTable.tsx (1)

57-58: Consider using a stable unique key from the data object instead of the array index.

Relying on the index as a key may lead to potential rendering issues when list items get reordered or removed. If each symptom has a unique ID, using that as the key is a best practice.

src/components/Patient/diagnosis/DiagnosisTable.tsx (1)

57-58: Prefer a unique data-derived key over the index.

Using the index as a key can cause unexpected UI re-rendering and performance concerns if items change order. If the diagnosis object contains a unique identifier, please leverage that.

src/components/Patient/allergy/AllergyTable.tsx (1)

56-57: Use a stable unique key instead of the index if possible.

If the allergy object includes a unique ID field, using that as the key will provide a more consistent reconciliation in React than using the array index.

src/components/Patient/MedicationStatementList.tsx (1)

100-101: Leverage a data-specific ID as the table row key rather than the array index.

Relying on array indices can hamper React’s re-rendering optimizations, especially if the order of medications.results changes. A unique identifier from the statement object is preferred.

src/components/Form/AutoCompleteAsync.tsx (1)

200-202: Consider using a unique field instead of the index for the key prop.
Relying on the array index can lead to subtle bugs, especially if the list's order changes, and can hamper React's reconciliation. If each option object has a unique identifier (e.g., option.id), it is a best practice to use that as the key prop for more stable and predictable renders.

- key={index}
+ key={option.id}
src/pages/Appointments/AppointmentDetail.tsx (1)

461-464: Use a more stable key in mapped status items.
Similar to the recommendation above, prefer a unique identifier if available (e.g., status string) instead of relying on index. This helps React accurately manage the list without potential misalignment when items are inserted or reordered.

- <SelectItem key={index} value={status}>
+ <SelectItem key={status} value={status}>
src/Utils/pubsubContext.tsx (2)

4-4: Consider removing underscore prefix or using a more descriptive name.
Typically, underscores are used to denote private or internal usage. If this context type is intended for broader use, renaming _PubSubContext to something without an underscore can improve clarity.


14-14: Ensure consistency between type and variable names.
Here, the context variable is called PubSubContext while the type is named _PubSubContext. Aligning these names will help maintain a predictable naming convention throughout the codebase.

src/components/ui/sidebar.tsx (2)

32-32: Maintain naming consistency.
Renaming SidebarContext to _SidebarContext (or vice versa) helps avoid confusion between type and variable names. Using a descriptive term instead of the underscore can also improve clarity.


112-112: Consider relying on inferred type for memo.
Specifying <_SidebarContext> in React.useMemo<_SidebarContext>(...) is correct but may be redundant if TypeScript can infer it. Omitting the explicit type parameter might simplify the code.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2ce556b and 986a0ef.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (18)
  • package.json (2 hunks)
  • src/Locale/update_locale.js (1 hunks)
  • src/Utils/pubsubContext.tsx (2 hunks)
  • src/components/Common/Avatar.tsx (1 hunks)
  • src/components/Common/ExcelFIleDragAndDrop.tsx (4 hunks)
  • src/components/Form/AutoCompleteAsync.tsx (1 hunks)
  • src/components/Form/FormFields/PhoneNumberFormField.tsx (1 hunks)
  • src/components/Form/FormFields/TextAreaFormField.tsx (1 hunks)
  • src/components/Form/FormFields/TextFormField.tsx (1 hunks)
  • src/components/Patient/MedicationStatementList.tsx (1 hunks)
  • src/components/Patient/allergy/AllergyTable.tsx (1 hunks)
  • src/components/Patient/diagnosis/DiagnosisTable.tsx (1 hunks)
  • src/components/Patient/symptoms/SymptomTable.tsx (1 hunks)
  • src/components/Resource/ResourceCreate.tsx (1 hunks)
  • src/components/ui/command.tsx (1 hunks)
  • src/components/ui/sidebar.tsx (3 hunks)
  • src/hooks/useFileManager.tsx (3 hunks)
  • src/pages/Appointments/AppointmentDetail.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (5)
  • src/components/Form/FormFields/TextAreaFormField.tsx
  • src/components/ui/command.tsx
  • src/components/Form/FormFields/PhoneNumberFormField.tsx
  • src/components/Form/FormFields/TextFormField.tsx
  • src/components/Common/Avatar.tsx
🚧 Files skipped from review as they are similar to previous changes (5)
  • src/Locale/update_locale.js
  • src/components/Resource/ResourceCreate.tsx
  • src/hooks/useFileManager.tsx
  • src/components/Common/ExcelFIleDragAndDrop.tsx
  • package.json
🔇 Additional comments (1)
src/components/ui/sidebar.tsx (1)

42-42: Verify references to the old type.
Confirm there are no lingering references to the previous SidebarContext type across the project. Inconsistent references could lead to type-check or runtime issues.

✅ Verification successful

No external references found to SidebarContext types
All references to SidebarContext and _SidebarContext are properly contained within src/components/ui/sidebar.tsx. No type inconsistencies detected.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Searching for any old references to `SidebarContext` or `_SidebarContext` outside of this file
rg -A 3 'SidebarContext' 
rg -A 3 '_SidebarContext'

Length of output: 2124

@github-actions github-actions bot removed the merge conflict pull requests with merge conflict label Jan 24, 2025
@github-actions github-actions bot added the merge conflict pull requests with merge conflict label Jan 24, 2025
Copy link

👋 Hi, @AdityaJ2305,
Conflicts have been detected against the base branch. Please rebase your branch against the base branch.


This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (4)
eslint.config.mjs (4)

14-22: Consider adding more common ignore patterns

Consider adding these common patterns to the ignore list:

  • coverage/ for test coverage reports
  • node_modules/ for dependencies
  • .next/ if using Next.js
  • *.min.js for minified files
  ignores: [
    "**/dist",
    "**/public",
    "**/lib",
    "**/build",
    "**/*.css",
    "**/*.csv",
    "**/Dockerfile",
+   "**/coverage",
+   "**/node_modules",
+   "**/.next",
+   "**/*.min.js",
  ],

30-30: Update ECMAScript version

Consider updating to the latest ECMAScript version (2024) for access to newer JavaScript features.

-      ecmaVersion: 12,
+      ecmaVersion: 2024,

65-81: Enhance TypeScript type-checking rules

Consider adding these essential TypeScript rules for better type safety:

  rules: {
    ...tseslint.configs.recommended.rules,
+   "@typescript-eslint/strict-boolean-expressions": "error",
+   "@typescript-eslint/no-floating-promises": "error",
+   "@typescript-eslint/await-thenable": "error",
+   "@typescript-eslint/no-misused-promises": "error",
    "@typescript-eslint/no-unused-vars": [
      "error",
      {
        argsIgnorePattern: "^_",
        varsIgnorePattern: "^_",
        caughtErrorsIgnorePattern: "^_",
      },
    ],

132-134: Refine i18next callee exclusions

The current configuration excludes all callees with ".*". Consider explicitly listing allowed callees instead of excluding everything.

  callees: {
-   exclude: [".*"],
+   include: ["t", "i18next.t", "i18n.t"],
  },
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a51a1ac and 932ea50.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (1)
  • eslint.config.mjs (1 hunks)
🔇 Additional comments (3)
eslint.config.mjs (3)

6-6: Correct the Prettier plugin import

The import statement for the Prettier plugin is incorrect.


94-96: Document reasons for disabled React rules

Please add comments explaining why these rules are disabled:

  • react/prop-types
  • react/no-children-prop
  • react/no-unescaped-entities

This helps future maintainers understand the decisions.


106-112: Verify the import paths configuration

Ensure that the @ prefix matches your TypeScript path aliases configuration.

✅ Verification successful

Import paths configuration is correctly aligned

The @ prefix in ESLint's no-relative-import-paths rule matches your TypeScript path aliases configuration, which uses @/*, @core/*, and @careConfig as aliases.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify TypeScript path aliases configuration matches ESLint import paths prefix

# Check tsconfig.json for path aliases
echo "Checking TypeScript path aliases configuration..."
if [ -f tsconfig.json ]; then
    jq '.compilerOptions.paths' tsconfig.json
else
    echo "tsconfig.json not found"
fi

Length of output: 289

eslint.config.mjs Show resolved Hide resolved
@AdityaJ2305
Copy link
Contributor Author

Hey Team, ready for review and testing
cc: @nihal467 @sainak @rithviknishad

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 932ea50 and 81dbd2c.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (1)
  • src/components/Patient/PatientDetailsTab/Demography.tsx (1 hunks)

@rithviknishad rithviknishad added needs review and removed question Further information is requested Deploy-Failed Deplyment is not showing preview merge conflict pull requests with merge conflict needs-triage labels Jan 25, 2025
Copy link

👋 Hi, @AdityaJ2305,
Conflicts have been detected against the base branch. Please rebase your branch against the base branch.


This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there.

@github-actions github-actions bot added the merge conflict pull requests with merge conflict label Jan 25, 2025
src/components/Resource/ResourceCreate.tsx Outdated Show resolved Hide resolved
src/components/ui/command.tsx Outdated Show resolved Hide resolved
@rithviknishad rithviknishad removed the merge conflict pull requests with merge conflict label Jan 25, 2025
@rithviknishad rithviknishad merged commit 7e10ba0 into ohcnetwork:develop Jan 25, 2025
6 of 8 checks passed
Copy link

@AdityaJ2305 Your efforts have helped advance digital healthcare and TeleICU systems. 🚀 Thank you for taking the time out to make CARE better. We hope you continue to innovate and contribute; your impact is immense! 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade eslint to v9
3 participants