Skip to content

DEV: Consolidate ESLint configs #4726

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

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

pawelangelow
Copy link
Collaborator

@pawelangelow pawelangelow commented Jul 16, 2025

Why?

ESLint supports multiple configurations across different directories, allowing for specific rules per project or folder. While this can be useful in large, highly distinct codebases, it introduces some downsides:

  • More dependencies to manage across sub-configs
  • Increased complexity in configuration maintenance
  • Performance overhead, as ESLint must parse and load separate configs during each run

What’s Changed

This PR consolidates all ESLint configurations into a single, unified setup:

  • Shared rules, plugins, and settings are now centralized
  • Folder- or project-specific rules are preserved via targeted overrides
  • Redundant dependencies and configuration files have been removed

Benefits

  • Simplified configuration management
  • Fewer dependencies to maintain
  • Improved performance and consistency across linting runs
  • Easier migration to the newest versions

This streamlines our setup without sacrificing rule specificity where it’s still needed.

This PR focuses solely on unifying the ESLint config - as you’ll notice, many rules are currently turned off. The goal here is to avoid one massive PR full of unrelated code changes triggered by lint rule enforcement.

How We'll Apply the Rules

Instead of enabling everything at once, we’ll gradually reintroduce rules in focused PRs. Each PR will target a specific rule (or a group of related rules) and include only the files affected by those changes. This keeps the review process manageable and minimizes disruption.

Example

Let’s say we want to re-enable the 'prefer-const' rule for the API codebase.

  1. Start by verifying a clean lint state:
    Run yarn lint:api (or yarn lint if you prefer). Using the specific api command provides faster feedback.

    • You should see no ESLint errors at this point.
  2. Remove the override for the rule:
    Delete the line 'prefer-const': 'off' from the ESLint config (that particular section).

  3. Run the linter again:
    You should now see 'prefer-const' errors reported.

  4. Fix the reported issues.

  5. Re-run the linter:
    Make sure no linting errors remain.

  6. Done!

Note:
If you're fixing lint issues in api/test or ui/src/packages, keep in mind that these directories may inherit rules from their parent configs. To see accurate lint results for these folders, you might need to temporarily disable parent-level overrides.

@pawelangelow pawelangelow self-assigned this Jul 16, 2025
Copy link
Contributor

github-actions bot commented Jul 16, 2025

Code Coverage - Integration Tests

Status Category Percentage Covered / Total
🟢 Statements 81.56% 16193/19853
🟡 Branches 64.38% 7265/11283
🟡 Functions 70.39% 2268/3222
🟢 Lines 81.19% 15231/18758

Copy link
Contributor

github-actions bot commented Jul 16, 2025

Code Coverage - Frontend unit tests

St.
Category Percentage Covered / Total
🟢 Statements 81.37% 18404/22617
🟡 Branches 67% 8068/12042
🟡 Functions 75.14% 4867/6477
🟢 Lines 81.76% 18007/22025

Test suite run success

4793 tests passing in 628 suites.

Report generated by 🧪jest coverage report action from 77a3cb3

valkirilov
valkirilov previously approved these changes Jul 17, 2025
Copy link
Contributor

Code Coverage - Backend unit tests

St.
Category Percentage Covered / Total
🟢 Statements 92.34% 13786/14930
🟡 Branches 73.98% 4142/5599
🟢 Functions 85.82% 2124/2475
🟢 Lines 92.13% 13179/14305

Test suite run success

2941 tests passing in 286 suites.

Report generated by 🧪jest coverage report action from 77a3cb3

@pawelangelow pawelangelow marked this pull request as ready for review July 17, 2025 13:53
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.

2 participants