import js from "../../frontend/node_modules/@eslint/js/src/index.js";
import globals from "../../frontend/node_modules/globals/index.js";

const sharedGlobals = {
  ...globals.browser,
  ...globals.node,
  ...globals.jest,
};

export default [
  js.configs.recommended,
  {
    files: ["frontend/src/**/*.js", "testing/frontend/**/*.js", "testing/frontend/**/*.mjs"],
    languageOptions: {
      ecmaVersion: "latest",
      sourceType: "module",
      globals: sharedGlobals,
    },
    rules: {
      "no-unused-vars": ["error", { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }],
      "no-undef": "error",
    },
  },
];
