Files
ProxmoxVE-Local/eslint.config.js
CanbiZ 1945b14694 Update ESLint config to use FlatCompat and expand ignores
Switched to using FlatCompat for ESLint configuration and extended the ignore list to include 'next-env.d.ts', 'postcss.config.js', and 'prettier.config.js'. This improves compatibility and prevents linting of config and environment files.
2025-11-28 12:23:47 +01:00

57 lines
1.7 KiB
JavaScript

import { FlatCompat } from "@eslint/eslintrc";
import tseslint from "typescript-eslint";
const compat = new FlatCompat({
baseDirectory: import.meta.dirname,
});
export default tseslint.config(
{
ignores: [".next", "next-env.d.ts", "postcss.config.js", "prettier.config.js"],
},
...compat.extends("next/core-web-vitals"),
{
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,
},
},
},
);