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

fix(lint): migrate to eslint v9 + flat config + recommended rules #867

Merged
merged 3 commits into from
Oct 10, 2024

Conversation

gdostie
Copy link
Contributor

@gdostie gdostie commented Oct 1, 2024

This pull request does the following improvements to our ESLint configuration:

  • Update to major version 9
  • Update other dependencies related to ESLint (like plugins) to their latest version
  • Migrate our configuration to flat config (new recommended config format)
  • Activate the recommended configurations from eslint and typescript-eslint
  • Ensure we have a green CI by either fixing newly discovered errors or disabling them
  • Stop running ESLint through Jest, ESLint now runs on test files by itself when running lint or lint:fix

Note to the reviewers for discussion:

  • I tagged these changes as breaking as a preventive measure since some types have become stricter than they were. For instance, any isn't accepted explicitly as a valid type anymore, so I had to narrow it down to something more meaningful.
  • There are a lot of usage of any that I simply let it be and disabled the rule, because I don't have enough knowledge of the feature itself to assert the correct type. Perhaps we could let this branch live longer and work on fixing them all before merging? Or merge as is and continue like that.
  • This is a really big PR, take your time to read it. This change was done as a side project and can be kept alive until we are truly satisfied with the new state. A lot of changes have been automatically fixed by ESLint itself, but some errors required manual intervention.

Acceptance Criteria

  • My changes are publicly available, documented, and deployed in production. (i.e. on Swagger)
  • JSDoc annotates each property added in the exported interfaces
  • The proposed changes are covered by unit tests
  • Commits containing breaking changes a properly identified as such
  • README.md is adjusted to reflect the proposed changes (if relevant)
  • My merge commit message will be conventional (See Conventional Commit)

@gdostie gdostie changed the title ESlint v9 + Flat config + Recommended rules refactor: ESLint v9 + Flat config + Recommended rules Oct 1, 2024
@gdostie gdostie force-pushed the eslint-v9 branch 2 times, most recently from f89629e to f0337dd Compare October 1, 2024 18:59
BREAKING CHANGE: We updated our config to the recommended typescript-eslint typed rules
 so some types have become stricter than they were before.
src/APICore.ts Show resolved Hide resolved
@gdostie gdostie requested review from FelixBlaisThon and removed request for dmgauthier October 2, 2024 16:26
@gdostie gdostie added this pull request to the merge queue Oct 10, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 10, 2024
@gdostie gdostie changed the title refactor: ESLint v9 + Flat config + Recommended rules fix(lint): migrate to eslint v9 + flat config + recommended rules Oct 10, 2024
@gdostie gdostie added this pull request to the merge queue Oct 10, 2024
Merged via the queue into master with commit da19840 Oct 10, 2024
6 checks passed
@gdostie gdostie deleted the eslint-v9 branch October 10, 2024 20:34
Copy link

🎉 This PR is included in version 56.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

5 participants