Skip to content

Conversation

Induranga-kawishwara
Copy link

Description

This commit addresses multiple issues in the project. In the SideList component, duplicate key warnings were fixed by replacing a hard-coded key with a unique key derived from the array index, ensuring each list item is uniquely identified by React. Unused dispatch parameters were removed from orgActions.js (line 431) and tutorialPageActions.js (line 280), which resolves ESLint no-unused-vars errors. Additionally, the ESLint configuration was migrated from the legacy .eslintrc format to the new flat config system required by ESLint v9. This involved creating an eslint.config.cjs file, converting it to use CommonJS syntax (replacing ES module syntax), and removing the unsupported "root" key. These changes improve code quality, resolve build and linting errors, and ensure compatibility with the latest ESLint standards.

Related Issue

None

Motivation and Context

The changes were necessary to fix linting and configuration errors that were preventing successful pre-commit checks and code builds. Resolving duplicate key warnings in React and unused variable errors not only cleans up the code but also enhances maintainability. Migrating to the new ESLint flat configuration format ensures future compatibility and adherence to modern development practices.

How Has This Been Tested?

  • Ran npm run lint to verify that all ESLint errors are resolved.
  • Confirmed that the Husky pre-commit hook now passes without errors.
  • Verified in the browser that the SideList component renders correctly without duplicate key warnings.
  • Performed local tests to ensure that other functionality (e.g., org actions) remains unaffected.

Screenshots or GIF (In case of UI changes):

N/A

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

… parameters

This commit resolves duplicate key warnings in the SideList component and removes unused dispatch parameters. In the SideList component, the hard-coded key "menu-items" has been replaced with a unique key generated from the array index, ensuring that each rendered item has a distinct identifier, which eliminates React’s duplicate key warnings. Additionally, unused dispatch parameters in orgActions.js and tutorialPageActions.js were removed, addressing ESLint no-unused-vars errors. These fixes enhance code quality and prevent potential issues during pre-commit checks.Migrated the project's ESLint configuration from .eslintrc.js to a new eslint.config.js file at the root. The new configuration uses the flat config format required by ESLint v9, specifying languageOptions, plugins, rules, and settings appropriately. This change resolves the error indicating that ESLint couldn't find an eslint.config file, ensuring compatibility with the latest ESLint version.
… parameters

This commit resolves duplicate key warnings in the SideList component and removes unused dispatch parameters. In the SideList component, the hard-coded key "menu-items" has been replaced with a unique key generated from the array index, ensuring that each rendered item has a distinct identifier, which eliminates React’s duplicate key warnings. Additionally, unused dispatch parameters in orgActions.js and tutorialPageActions.js were removed, addressing ESLint no-unused-vars errors. These fixes enhance code quality and prevent potential issues during pre-commit checks.Renamed eslint.config.js to eslint.config.cjs to ensure the configuration is treated as CommonJS.Removed the "root" key from eslint.config.cjs, as flat configs are always treated as the root.
@Induranga-kawishwara
Copy link
Author

Added some comments.

@Induranga-kawishwara
Copy link
Author

Added some comments

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

Successfully merging this pull request may close these issues.

1 participant