import js from '@eslint/js';
import tseslint from 'typescript-eslint';
import eslintConfigPrettier from 'eslint-config-prettier';
import globals from 'globals';

export default tseslint.config(
  {
    ignores: [
      'dist',
      '**/dist',
      '**/dist/**',
      '**/node_modules/**',
      '**/coverage/**',
      '.husky/**',
      '**/*.lock',
    ],
  },
  js.configs.recommended,
  ...tseslint.configs.recommended,
  eslintConfigPrettier,
  {
    languageOptions: {
      globals: { ...globals.node },
    },
    rules: {
      '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
      'no-console': 'off', // CLI tools output to stdout
    },
  },
  {
    // Browser-side dashboard assets — vanilla JS, no build step.
    files: ['packages/server/ui/**/*.js'],
    languageOptions: {
      globals: { ...globals.browser },
    },
  }
);
