import eslint from "@eslint/js"; import tseslint from "typescript-eslint"; import globals from "globals"; export default tseslint.config( // Global ignores { ignores: ["build/", "node_modules/", "coverage/"], }, // Base config for all files eslint.configs.recommended, ...tseslint.configs.recommended, // TypeScript files config { files: ["src/**/*.ts"], languageOptions: { ecmaVersion: 2022, sourceType: "module", globals: { ...globals.node, ...globals.es2022, }, }, rules: { "@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }], "@typescript-eslint/explicit-function-return-type": "off", "@typescript-eslint/no-explicit-any": "warn", }, }, // Relaxed rules for test files { files: ["src/**/*.test.ts"], rules: { // Allow any in test mocks and assertions "@typescript-eslint/no-explicit-any": "off", // Allow non-null assertions in tests "@typescript-eslint/no-non-null-assertion": "off", }, } );