text: // @ts-check
  
  /** @type {import('eslint').Linter.Config} */
  const config = {
    parser: '@typescript-eslint/parser',
    parserOptions: {},
    extends: [
      // /!\ Order matters: the next one overrides rules from the previous one
      'plugin:playwright/playwright-test',
      'plugin:jest/recommended',
      'plugin:unicorn/recommended',
      'airbnb-base',
      'plugin:@typescript-eslint/recommended',
      'plugin:prettier/recommended'
    ],
    plugins: ['simple-import-sort'],
    env: {
      browser: true
    },
  
    rules: {
      'no-underscore-dangle': 'off',
      'no-plusplus': 'off',
      'spaced-comment': 'off',
      camelcase: 'off',
  
      'import/no-extraneous-dependencies': 'off',
      'import/no-unresolved': 'off',
      'import/prefer-default-export': 'off',
      'import/extensions': 'off',
  
      'simple-import-sort/imports': [
        'error',
        {
          // https://github.com/lydell/eslint-plugin-simple-import-sort/blob/v7.0.0/src/imports.js#L5
          groups: [
            // Side effect imports
            ['^\\u0000'],
  
            // Packages
            // Things that start with a letter (or digit or underscore), or `@` followed by a letter
            ['^@?\\w'],
  
            // Absolute imports and other imports such as Vue-style `@/foo`
            // Anything not matched in another group
            ['^'],
  
            // Relative imports
            [
              // https://github.com/lydell/eslint-plugin-simple-import-sort/issues/15
  
              // ../whatever/
              '^\\.\\./(?=.*/)',
              // ../
              '^\\.\\./',
              // ./whatever/
              '^\\./(?=.*/)',
              // Anything that starts with a dot
              '^\\.',
              // .html are not side effect imports
              '^.+\\.html$',
              // .scss/.css are not side effect imports
              '^.+\\.s?css$'
            ]
          ]
        }
      ],
      'simple-import-sort/exports': 'error',
  
      'no-shadow': 'off',
      '@typescript-eslint/no-shadow': 'error',
  
      '@typescript-eslint/explicit-function-return-type': 'off',
      '@typescript-eslint/camelcase': 'off',
      '@typescript-eslint/class-name-casing': 'off',
      '@typescript-eslint/no-unused-vars': 'off',
      '@typescript-eslint/no-explicit-any': 'off',
      '@typescript-eslint/ban-ts-comment': 'off',
      '@typescript-eslint/explicit-module-boundary-types': 'off',
  
      'unicorn/filename-case': 'off',
      'unicorn/prevent-abbreviations': 'off',
      'unicorn/catch-error-name': 'off',
      'unicorn/prefer-query-selector': 'off',
      // FIXME Activate when ES modules are well supported
      'unicorn/prefer-module': 'off',
  
      'jest/no-restricted-matchers': 'error'
    },
  
    overrides: [
      {
        files: ['examples/**/*.ts'],
        rules: {
          'no-console': 'off',
          '@typescript-eslint/no-non-null-assertion': 'off',
          'unicorn/prefer-add-event-listener': 'off'
        }
      }
    ]
  };
  
  module.exports = config;
  