2025-07-27 11:47:38 -07:00
|
|
|
import { FlatCompat } from "@eslint/eslintrc";
|
2025-04-07 23:47:06 -07:00
|
|
|
import { dirname } from "path";
|
|
|
|
|
import { fileURLToPath } from "url";
|
|
|
|
|
|
|
|
|
|
const __filename = fileURLToPath(import.meta.url);
|
|
|
|
|
const __dirname = dirname(__filename);
|
|
|
|
|
|
|
|
|
|
const compat = new FlatCompat({
|
2025-07-27 10:05:37 -07:00
|
|
|
baseDirectory: __dirname,
|
2025-04-07 23:47:06 -07:00
|
|
|
});
|
|
|
|
|
|
2026-06-16 04:56:23 +05:30
|
|
|
const eslintConfig = [
|
|
|
|
|
...compat.extends("next/core-web-vitals", "next/typescript"),
|
|
|
|
|
{
|
|
|
|
|
rules: {
|
2026-06-16 14:51:25 +05:30
|
|
|
"no-restricted-imports": [
|
2026-06-16 04:56:23 +05:30
|
|
|
"error",
|
|
|
|
|
{
|
2026-06-16 14:51:25 +05:30
|
|
|
paths: [
|
|
|
|
|
{
|
|
|
|
|
name: "@/lib/env-config",
|
|
|
|
|
importNames: ["BACKEND_URL"],
|
|
|
|
|
message:
|
|
|
|
|
"Use buildBackendUrl(path, params) for browser-facing backend URLs. BACKEND_URL is empty in proxy mode; importing it bypasses the single URL seam.",
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
patterns: [
|
|
|
|
|
{
|
|
|
|
|
group: ["**/env-config", "**/env-config.ts"],
|
|
|
|
|
importNames: ["BACKEND_URL"],
|
|
|
|
|
message:
|
|
|
|
|
"Use buildBackendUrl(path, params). Import BACKEND_URL only inside lib/env-config.ts.",
|
|
|
|
|
},
|
|
|
|
|
],
|
2026-06-16 04:56:23 +05:30
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
];
|
2025-04-07 23:47:06 -07:00
|
|
|
|
|
|
|
|
export default eslintConfig;
|