-
Notifications
You must be signed in to change notification settings - Fork 470
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
Eslint upgrade to v9 #9344
base: develop
Are you sure you want to change the base?
Eslint upgrade to v9 #9344
Conversation
WalkthroughThe changes in this pull request involve the removal of the Changes
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
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
CodeRabbit Configuration File (
|
✅ Deploy Preview for care-ohc 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: 3
🧹 Outside diff range and nitpick comments (1)
eslint.config.mjs (1)
15-26
: Consider adding common directories to the ignore listThe current
ignores
list excludes several directories and file types. To further optimize linting performance, consider addingnode_modules
,.cache
, andcoverage
directories to the ignore list.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (1)
package-lock.json
is excluded by!**/package-lock.json
📒 Files selected for processing (3)
.eslintrc.json
(0 hunks)eslint.config.mjs
(1 hunks)package.json
(4 hunks)
💤 Files with no reviewable changes (1)
- .eslintrc.json
🔇 Additional comments (4)
eslint.config.mjs (2)
66-67
: Verify the parserOptions.project
path
Ensure that the project
path in parserOptions
("./tsconfig.json"
) correctly references your TypeScript configuration file. An incorrect path can lead to linting errors or reduced performance.
139-139
:
Verify the spread operator usage in MDX configuration
Using the spread operator with mdxPlugin.configs.recommended
may not work as expected. Confirm that this syntax is supported in the ESLint flat config. If issues arise, consider importing and extending the recommended configuration.
package.json (2)
63-63
: Addition of @radix-ui/react-icons
is appropriate
The new dependency @radix-ui/react-icons
has been added. Ensure it's used in the project to justify its inclusion.
108-110
: ESLint and related packages updated successfully
The updates to ESLint and its plugins align with the upgrade to ESLint v9. The inclusion of new packages like @eslint/compat
, @eslint/eslintrc
, and globals
supports the new configuration.
Also applies to: 128-129, 136-136, 138-138, 142-142, 144-144
package.json
Outdated
@@ -81,6 +81,7 @@ | |||
"dayjs": "^1.11.13", | |||
"echarts": "^5.5.1", | |||
"echarts-for-react": "^3.0.2", | |||
"eslint-plugin-markdown": "^5.1.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.
Move eslint-plugin-markdown
to devDependencies
eslint-plugin-markdown
is a development tool and should be listed under devDependencies
to prevent it from being included in the production build.
Apply this diff to fix the issue:
"dependencies": {
- "eslint-plugin-markdown": "^5.1.0",
},
"devDependencies": {
+ "eslint-plugin-markdown": "^5.1.0",
Committable suggestion skipped: line range outside the PR's diff.
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.
@amjithtitus09 this package is not required
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.
Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!
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 (2)
eslint.config.mjs (2)
26-50
: Consider adding TypeScript-specific compiler optionsWhile the global settings are well-configured, consider adding TypeScript compiler options for better type checking:
languageOptions: { ecmaVersion: 12, sourceType: "module", + parserOptions: { + project: "./tsconfig.json", + tsconfigRootDir: ".", + }, globals: { ...globals.browser, ...globals.node, }, parserOptions: { ecmaFeatures: { jsx: true, }, }, },
116-117
: Simplify Prettier configurationThe Prettier plugin automatically sets up both the plugin and config when using
eslint-plugin-prettier/recommended
.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (1)
package-lock.json
is excluded by!**/package-lock.json
📒 Files selected for processing (3)
eslint.config.mjs
(1 hunks)package.json
(4 hunks)src/components/Facility/AssetCreate.tsx
(6 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- package.json
🧰 Additional context used
🪛 eslint
eslint.config.mjs
[error] 10-11: Delete ⏎
(prettier/prettier)
[error] 118-118: Insert ⏎
(prettier/prettier)
🔇 Additional comments (5)
eslint.config.mjs (2)
1-24
: LGTM! Base configuration follows ESLint v9 best practices
The imports and base configuration are well-structured, following the new flat config format introduced in ESLint v9.
🧰 Tools
🪛 eslint
[error] 10-11: Delete ⏎
(prettier/prettier)
65-66
: Avoid spreading recommended rules directly
Spreading tseslint.configs.recommended.rules
and plugin rules can cause conflicts or unexpected behavior.
Also applies to: 86-87
src/components/Facility/AssetCreate.tsx (3)
163-169
: LGTM! Improved readability of section visibility logic
The refactored implementation using direct conditional statements is clearer and maintains the same functionality.
196-207
: LGTM! Enhanced null safety in asset data handling
The addition of null checks before setting state values improves type safety and prevents potential runtime errors.
499-499
: LGTM! Improved className handling
The use of template literals for dynamic class assignments improves code readability and maintainability.
Hey @sainak, I've made the requested changes |
package.json
Outdated
@@ -81,6 +81,7 @@ | |||
"dayjs": "^1.11.13", | |||
"echarts": "^5.5.1", | |||
"echarts-for-react": "^3.0.2", | |||
"eslint-plugin-markdown": "^5.1.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.
@amjithtitus09 this package is not required
Proposed Changes
@ohcnetwork/care-fe-code-reviewers
Merge Checklist
Summary by CodeRabbit
New Features
Bug Fixes
Chores
AssetCreate
component without altering its core functionality.