import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
{
ignores: ["**/dist/**", "**/node_modules/**", "**/*.js", "**/*.cjs"],
},
{
files: ["**/*.ts"],
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
// TypeScript-specific rules
"@typescript-eslint/no-unused-vars": [
"error",
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
],
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-non-null-assertion": "warn",
// General rules
"no-console": ["warn", { allow: ["error", "warn", "info"] }],
"prefer-const": "error",
eqeqeq: ["error", "always"],
},
},
{
// Test files - more relaxed rules
files: ["**/__tests__/**/*.ts", "**/*.test.ts"],
rules: {
"@typescript-eslint/no-explicit-any": "off",
"no-console": "off",
},
}
);