import reactConfig from '@northern.tech/eslint-config/react.js';
import { defineConfig, globalIgnores } from 'eslint/config';
import tseslint from 'typescript-eslint';

export default defineConfig([
  globalIgnores(['node_modules/', 'dist/', '**/api/types/', 'tests/licenses']),
  ...reactConfig,
  {
    // The shared config only targets js/mjs/cjs/ts/tsx; keep legacy .jsx files linted too.
    files: ['**/*.jsx'],
    languageOptions: {
      parser: tseslint.parser,
      parserOptions: { ecmaFeatures: { jsx: true } }
    }
  },
  {
    files: ['tests/e2e_tests/**/*'],
    rules: {
      'react-hooks/rules-of-hooks': 'off'
    }
  }
]);
