// https://eslint.org/docs/latest/use/configure/configuration-files

import jsonPlugin from '@eslint/json';
import htmlPlugin from '@html-eslint/eslint-plugin';
import htmlParser from '@html-eslint/parser';

/**
 * @type {Array<import('eslint').Linter.Config>}
 */
export default [
  {
    // https://eslint.org/docs/latest/use/configure/ignore#the-eslintignore-file
    ignores: [
      // Anywhere
      '**/*.DotSettings.user',
      '**/*.aliases',
      '**/*.asv',
      '**/*.cache',
      '**/*.cf',
      '**/*.ghw',
      '**/*.iml',
      '**/*.lvlps',
      '**/*.mexmaca64',
      '**/*.mexmaci64',
      '**/*.pdf',
      '**/*.slxc',
      '**/*.swc/**/*',
      '**/*.tfstate',
      '**/*.unsealed.yaml',
      '**/*_pb2.py',
      '**/.DS_Store',
      '**/.ansible/**/*',
      '**/.claude/**/*',
      '**/.coverage',
      '**/.coverage/**/*',
      '**/.deepeval/**/*',
      '**/.env.*.local',
      '**/.generated/**/*',
      '**/.gitkeep',
      '**/.idea/**/*',
      '**/.pytest_cache/**/*',
      '**/.ruff_cache/**/*',
      '**/.terraform/**/*',
      '**/.vagrant/**/*',
      '**/.venv/**/*',
      '**/.vscode/**/*',
      '**/AGENTS.md',
      '**/__pycache__/**/*',
      '**/build/**/*',
      '**/certificates/**/*',
      '**/cmake-build-debug/**/*',
      '**/codegen/**/*',
      '**/coverage.xml',
      '**/coverage/**/*',
      '**/data/**/*',
      '**/dist/**/*',
      '**/models/**/*',
      '**/node_modules/**/*',
      '**/output/**/*',
      '**/secrets.auto.tfvars',
      '**/slprj/**/*',
      '**/target/**/*',

      // Root (cannot have leading /)
      '.aider.chat.history.md',
      '.aider.tags.cache.v3/**/*',
      '.git/**/*',
      '.github/**/*',
      '.mypy_cache/**/*',
      'build-desktop-qt-Qt_*-Debug/**/*',
      'dump.rdb',
      'logs/**/*',
      'logs.log',
      'submodules/**/*',
      'vendor/**/*',
      'west-master-k3s.yaml',

      // Directories
      'aerospace/hm-openaerostruct/n2.html',
      'aerospace/hm-openaerostruct/reports/**/*',
      'api/api-go/config/config_loader/opal_auth_public_key.pem',
      'api/api-go/config/config_loader/server.crt',
      'api/api-go/config/config_loader/server.key',
      'api/api-go/coverage.txt',
      'api/api-node/.clinic/**/*',
      'api/api-node/.stryker-tmp/**/*',
      'api/api-node/public/**/*',
      'api/api-node/reports/**/*',
      'ensemble-learning/boosting/hm-catboost/catboost_info/**/*',
      'caddy/public/**/*',
      'cloud-cost/komiser/komiser.db',
      'cloud-platform/aws/aws-secrets-manager/secrets/*-credentials.json',
      'computational-fluid-dynamics/openfoam/simulations/*/0.*/**/*',
      'computational-fluid-dynamics/openfoam/simulations/*/constant/polyMesh/**/*',
      'data-orchestration/hm-prefect/workflows/*/*-deployment.yaml',
      'data-processing/flink/applications/*/.classpath',
      'data-processing/flink/applications/*/.project',
      'data-processing/flink/applications/*/.settings/**/*',
      'data-processing/flink/applications/*/dependency-reduced-pom.xml',
      'data-processing/flink/applications/*/src/main/resources/*.properties',
      'data-processing/hm-spark/applications/*/.bsp/**/*',
      'data-processing/kafka/kafka-client/kafka-c/*/config.ini',
      'data-transformation/dbt/projects/*/dbt_packages/**/*',
      'data-transformation/dbt/projects/*/logs/**/*',
      'data-visualization/grafana/hm-panel-plugin/.config/**/*',
      'data-visualization/grafana/hm-panel-plugin/test-results/**/*',
      'data-visualization/grafana/hm-panel-plugin/playwright-report/**/*',
      'data-visualization/grafana/hm-panel-plugin/playwright/**/*',
      'data-visualization/metabase/plugins/**/*',
      'desktop/desktop-qt/CMakeLists.txt.user',
      'embedding/hm-imagebind/.checkpoints/**/*',
      'hardware-in-the-loop/national-instruments/veristand/VeriStandZeroMQBridge/VeriStandZeroMQBridge/bin/**/*',
      'hardware-in-the-loop/national-instruments/veristand/VeriStandZeroMQBridge/VeriStandZeroMQBridge/obj/**/*',
      'hardware-in-the-loop/national-instruments/veristand/VeriStandZeroMQBridge/packages/**/*',
      'infrastructure/ansible/secrets/**/*',
      'infrastructure/hm-pulumi/passphrase.txt',
      'infrastructure/opentofu/environments/production/aws/storage/files/amazon-msk/*/plugins/*.zip',
      'kubernetes/certificates/**/*',
      'kubernetes/data/config-loader/**/*',
      'kubernetes/data/elastic-apm/**/*',
      'kubernetes/data/hasura/hasura-graphql-engine/**/*',
      'kubernetes/data/hm-alpine/**/*',
      'kubernetes/data/hm-kafka/hm-kafka/**/*',
      'kubernetes/data/hm-kafka/logging-kafka-connect/**/*',
      'kubernetes/data/hm-kafka/opa-kafka-connect/**/*',
      'kubernetes/data/model-server/model-store/**/*',
      'kubernetes/data/opal-server/**/*',
      'kubernetes/data/yugabyte/**/*',
      'kubernetes/manifests-raw/**/*',
      'large-language-model-post-training/fine-tuning/hm-axolotl/last_run_prepared/**/*',
      'large-language-model-post-training/fine-tuning/hm-llama-factory/saves/**/*',
      'large-language-model-post-training/fine-tuning/hm-unsloth/unsloth_compiled_cache/**/*',
      'large-language-model-post-training/fine-tuning/hm-unsloth/unsloth_training_checkpoints/**/*',
      'convolutional-neural-network/wandb/**/*',
      'graph-neural-network/dataset/**/*',
      'graph-neural-network/wandb/**/*',
      'machine-learning/configuration-management/hm-hydra-zen/outputs/**/*',
      'machine-learning/hm-autogluon/AutogluonModels/**/*',
      'machine-learning/hm-metaflow/flows/*/.metaflow/**/*',
      'machine-learning/hm-mlflow/experiments/*/lightning_logs/**/*',
      'machine-learning/hm-mlflow/experiments/*/mlruns/**/*',
      'machine-learning/hm-mlflow/experiments/*/wandb/**/*',
      'machine-learning/hm-nvidia-modulus/launch.log',
      'machine-learning/neural-forecasting/*/lightning_logs/**/*',
      'mobile/mobile-android/.gradle/**/*',
      'mobile/mobile-android/local.properties',
      'mobile/mobile-ios/*.xcodeproj/**/*',
      'mobile/mobile-ios/*.xcworkspace/**/*',
      'mobile/mobile-ios/Derived/**/*',
      'mobile/mobile-ios/Tuist/.build/**/*',
      'mobile/mobile-ios/buildServer.json',
      'mobile/mobile-ios/cobertura.xml',
      'mobile/mobile-ios/mobile-ios/Resources/Audio/**/*',
      'mobile/mobile-ios/mobile-ios/Resources/Models/**/*',
      'mobile/mobile-react-native/.expo/**/*',
      'reverse-engineering/*/main',
      'robotics/robot-operating-system/bags/**/*',
      'robotics/robot-operating-system/install/**/*',
      'robotics/robot-operating-system/log/**/*',
      'security/sops/age-key.txt',
      'web-playwright/test-results/**/*',
      'web-playwright/playwright-report/**/*',
      'web/.lighthouseci/**/*',
      'web/public/sitemap.xml',
      'web/storybook-static/**/*',
      'web/tmp/**/*',

      // eslint.config.mjs specific
      '**/*.mjs',
      '**/package-lock.json',
      '**/tsconfig.json',
    ],
  },
  {
    files: ['**/*.html'],
    languageOptions: {
      parser: htmlParser,
    },
    plugins: {
      '@html-eslint': htmlPlugin,
    },
    rules: {
      ...htmlPlugin.configs['flat/recommended'].rules,
      '@html-eslint/indent': ['error', 2],
      '@html-eslint/use-baseline': ['error', { available: 'newly' }],
    },
  },
  {
    files: ['**/*.{geojson,json,kp}'],
    language: 'json/json',
    plugins: {
      json: jsonPlugin,
    },
    rules: {
      ...jsonPlugin.configs.recommended.rules,
    },
  },
  {
    files: ['**/*.jsonc'],
    language: 'json/jsonc',
    plugins: {
      json: jsonPlugin,
    },
    rules: {
      ...jsonPlugin.configs.recommended.rules,
    },
  },
  {
    files: ['**/*.json5'],
    language: 'json/json5',
    plugins: {
      json: jsonPlugin,
    },
    rules: {
      ...jsonPlugin.configs.recommended.rules,
    },
  },
];
