ESLint - Flat file config in 2024

This was an easy fix previously. Under env - you had to set the jest to true.

{
  "env": {
    "jest": true
  }
}

ESLint Jest error showing 'jest' is not defined in the terminal

The fix in Eslint 9 is

export default [
  {
    languageOptions: {
      globals: {
        ...globals.jest,
      },
    },
  },

Reference link - https://eslint.org/docs/latest/use/configure/language-options 🔗