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

chore: Implement updated coding standards #9562

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

arpitnath
Copy link
Collaborator

@arpitnath arpitnath commented May 1, 2024

Update ESLint configurations and introduce new rulesets to align with the newly established coding standards. This ensures enhanced code quality, maintainability, and performance across all development tiers. Includes adjustments to React-specific performance rules and backend logical complexity management.

Integrating the eslint-plugin-sonarjs, eslint-plugin-react-perf, and the complexity rule from ESLint into coding standards: improve code quality, performance, and maintainability. Here are key points explaining how each of these tools contributes to upholding the new coding standards:

1. eslint-plugin-sonarjs

  • Purpose: Enhances code quality by identifying bugs and suspicious patterns in JavaScript and TypeScript.
  • Benefits:
    • Bug Detection: Automatically detects potential errors and bugs that might not be obvious during code reviews.
    • Code Smell Reduction: Helps in identifying and eliminating "code smells" which can make the codebase difficult to maintain and extend.
    • Improved Maintainability: Encourages developers to write clear and maintainable code by enforcing best practices and logical code patterns.

2. eslint-plugin-react-perf

  • Purpose: Focuses on performance optimizations specifically for React applications.
  • Benefits:
    • Performance Optimization: Identifies patterns in React that could lead to performance bottlenecks such as unnecessary re-renders and misuse of React hooks.
    • Best Practices Enforcement: Encourages the use of performance best practices in React development, such as correct usage of memoization and pure components.
    • User Experience Improvement: By optimizing React components, the overall user experience is enhanced due to faster component rendering and reduced load times.

3. Complexity Rule (eslint-plugin-complexity)

  • Purpose: Limits the cyclomatic complexity of code, which is a quantitative measure of the number of linearly independent paths through a program's source code.
  • Benefits:
    • Simpler Code Logic: Ensures that functions and methods are simple to understand and debug by limiting the complexity of conditional logic.
    • Error Reduction: Complex code is more prone to errors; reducing complexity inherently reduces the risk of bugs.
    • Enhanced Code Reviews: Simpler code means faster and more effective code reviews, as reviewers can more easily understand the logic and intent of the code.

Server-side Configuration:

  • eslint-plugin-sonarjs is included to ensure that both existing and new server-side code adheres to new standards of logic and maintainability.
  • Specific rules such as max-lines-per-function and complexity needs to be updated as per requirement

Frontend Configuration:

  • Along with eslint-plugin-sonarjs, eslint-plugin-react-perf is used to focus on the performance aspects of React components, crucial for frontend applications where user interaction and speed are key.
  • The complexity rule is also crucial for managing the logic complexity in interactive UIs, ensuring that components are both efficient and maintainable.

Update ESLint configurations and introduce new rulesets to align with the newly established coding standards. This ensures enhanced code quality, maintainability, and performance across all development tiers. Includes adjustments to React-specific performance rules and backend logical complexity management.
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.

None yet

1 participant