Skip to content

Update eslint config to compatibility mode config to support ESLint 9

Description

Related to https://gitlab.com/gitlab-org/customers-gitlab-com/-/merge_requests/9696+

ESLint 9 requires a major overhaul of the .eslintrc.yml approach (see relevant docs). ESLint calls this "flat config" and can be supported in version 8.

For us to upgrade to ESLint version 9, we need to move our configuration to eslint.config.js from .eslintrc.yml.

Investigation

I took a whack at this in https://gitlab.com/gitlab-org/customers-gitlab-com/-/merge_requests/9696+ but got hung up on:

  • You can set ESLINT_USE_FLAT_CONFIG=false and tell ESLint to look for .eslintrc.yml, but I ran into compatibility issues with our @gitlab/eslint-plugin package trying to use the Vue plugin 🤔

    Screenshot_2024-04-20_at_4.20.34_PM

  • We'll need to eventually migrate to the flat config approach. I'm not sure how to migrate our existing extends: and plugins: reference. Are these 3rd party plugins even ESLint 9 compatible 🤔

Following steps:

In this issue we migrated to compatibility mode flat config. In Update eslint config to flat config (#13534) we should migrate to a true flat config (as long as 3rd party configs/plugins allow that).

Edited by Kos Palchyk