import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
import prettierConfig from "eslint-config-prettier";
export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
prettierConfig,
{
ignores: ["dist/**", "node_modules/**", "*.config.js"],
},
{
languageOptions: {
ecmaVersion: 2022,
sourceType: "module",
parserOptions: {
project: "./tsconfig.json",
},
},
rules: {
// TypeScript specific
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-non-null-assertion": "warn",
"@typescript-eslint/consistent-type-imports": [
"error",
{ prefer: "type-imports", fixStyle: "inline-type-imports" },
],
// General
"no-console": ["warn", { allow: ["warn", "error"] }],
"prefer-const": "error",
"no-var": "error",
eqeqeq: ["error", "always"],
},
},
// Test files - allow console.log and non-null assertions
{
files: ["tests/**/*.ts"],
rules: {
"no-console": "off",
"@typescript-eslint/no-non-null-assertion": "off",
},
},
);