// Flat-config ESLint setup for fast-mcp.
//
// Mirrors the conservative ruleset from agents-marketplace
// (fastxyz/fast-shop#19): typescript-eslint v8 recommended (NOT
// recommended-type-checked, which would slow CI), `^_` argsIgnorePattern,
// and no-explicit-any as warn (not error) so existing patterns don't
// immediately fail CI.
//
// Tighten in follow-ups once the team agrees on the diff cost.

import js from "@eslint/js";
import tseslint from "typescript-eslint";

export default tseslint.config(
  {
    ignores: [
      "**/dist/**",
      "**/node_modules/**",
      "**/coverage/**",
      "**/.worktrees/**",
      "**/.claude/**",
      // pack scripts are ESM .mjs files — lint them separately if needed
      "scripts/**/*.mjs"
    ]
  },

  js.configs.recommended,
  ...tseslint.configs.recommended,

  {
    rules: {
      "@typescript-eslint/no-unused-vars": [
        "error",
        {
          argsIgnorePattern: "^_",
          varsIgnorePattern: "^_",
          caughtErrorsIgnorePattern: "^_"
        }
      ],
      "@typescript-eslint/no-explicit-any": "warn"
    }
  },

  {
    files: ["**/*.test.ts", "test/**/*.ts"],
    rules: {
      "@typescript-eslint/no-explicit-any": "off"
    }
  }
);
