62 lines
1.9 KiB
JavaScript
62 lines
1.9 KiB
JavaScript
import tseslint from "typescript-eslint";
|
|
import { createRequire } from "module";
|
|
import { fileURLToPath } from "url";
|
|
import path from "path";
|
|
|
|
const __filename = fileURLToPath(import.meta.url);
|
|
const __dirname = path.dirname(__filename);
|
|
const require = createRequire(import.meta.url);
|
|
|
|
// Import Next.js config directly (it's already in flat config format)
|
|
const nextConfig = require("eslint-config-next/core-web-vitals");
|
|
|
|
export default tseslint.config(
|
|
{
|
|
ignores: [".next", "node_modules"],
|
|
},
|
|
...nextConfig,
|
|
{
|
|
files: ["**/*.ts", "**/*.tsx"],
|
|
extends: [
|
|
...tseslint.configs.recommended,
|
|
...tseslint.configs.recommendedTypeChecked,
|
|
...tseslint.configs.stylisticTypeChecked,
|
|
],
|
|
rules: {
|
|
"@typescript-eslint/array-type": "off",
|
|
"@typescript-eslint/consistent-type-definitions": "off",
|
|
"@typescript-eslint/consistent-type-imports": [
|
|
"warn",
|
|
{ prefer: "type-imports", fixStyle: "inline-type-imports" },
|
|
],
|
|
"@typescript-eslint/no-unused-vars": [
|
|
"warn",
|
|
{ argsIgnorePattern: "^_" },
|
|
],
|
|
"@typescript-eslint/require-await": "off",
|
|
"@typescript-eslint/no-misused-promises": [
|
|
"error",
|
|
{ checksVoidReturn: { attributes: false } },
|
|
],
|
|
// Disable problematic rules that are causing issues with Node.js APIs and WebSocket libraries
|
|
"@typescript-eslint/unbound-method": "off",
|
|
"@typescript-eslint/consistent-generic-constructors": "off",
|
|
"@typescript-eslint/no-unsafe-assignment": "off",
|
|
"@typescript-eslint/no-explicit-any": "off",
|
|
"@typescript-eslint/no-base-to-string": "off",
|
|
"@typescript-eslint/no-unsafe-call": "off",
|
|
"@typescript-eslint/no-unsafe-member-access": "off",
|
|
},
|
|
},
|
|
{
|
|
linterOptions: {
|
|
reportUnusedDisableDirectives: true,
|
|
},
|
|
languageOptions: {
|
|
parserOptions: {
|
|
projectService: true,
|
|
},
|
|
},
|
|
},
|
|
);
|