module.exports = {
  extends: [
    'next/core-web-vitals',
    'plugin:@typescript-eslint/recommended',
    'eslint-config-prettier',
  ],
  plugins: ['import'],
  settings: {
    'import/resolver': {
      typescript: {
        project: ['./tsconfig.json'],
      },
    },
  },
  rules: {
    'react/no-children-prop': 'off',
    '@typescript-eslint/no-explicit-any': 'off',
    '@typescript-eslint/no-unused-vars': 'off', // Turned off to reduce noise
    '@typescript-eslint/ban-types': 'off',
    'react-hooks/exhaustive-deps': 'off', // Turned off to reduce noise
    'import/named': 'error',
    'import/no-duplicates': 'error',
    'import/no-unresolved': 'error',
    // Disallow console - use logger from lib/logger.ts instead
    'no-console': 'error',
  },
  overrides: [
    {
      // Allow console in the logger utility (it's the abstraction layer)
      files: ['src/lib/logger.ts'],
      rules: {
        'no-console': 'off',
      },
    },
    {
      // Service worker runs in isolated context, can't import app modules
      files: ['src/sw.ts'],
      rules: {
        'no-console': 'off',
      },
    },
    {
      // API routes run on server, use server-side logging
      files: ['src/pages/api/**/*.ts'],
      rules: {
        'no-console': 'off',
      },
    },
  ],
};
