import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";
import header from "eslint-plugin-header";

/**
 * Workaround for issue described here
 * https://github.com/Stuk/eslint-plugin-header/issues/57
 */
header.rules.header.meta.schema = false;


/** @type {import('eslint').Linter.Config[]} */
export default [
  {
    ignores: [
      "src/assets",
      "src/karma.conf.js",
      "src/karma.conf.ci.js",
    ],
  },
  {files: ["**/*.{js,mjs,cjs,ts}"]},
  {languageOptions: { globals: globals.browser }},
  pluginJs.configs.recommended,
  ...tseslint.configs.recommended,
  {
    plugins: { header },
    rules: {
      "header/header": [
        2,
        "block",
        {
          "pattern": "Copyright.*VMware, Inc\\.|Copyright \\(c\\).*Broadcom\\.",
          "template": "\n * ******************************************************************\n * Copyright (c) 2025 Broadcom. All Rights Reserved.\n * Broadcom Confidential. The term \"Broadcom\" refers to Broadcom Inc.\n * and/or its subsidiaries.\n * ******************************************************************\n "
        }
      ],
    },
  },
  {
    rules: {
      "@typescript-eslint/no-explicit-any": "off"
    },
  }
];
