ERP-node/frontend/eslint.config.mjs

53 lines
1.6 KiB
JavaScript

import { dirname } from "path";
import { fileURLToPath } from "url";
import { FlatCompat } from "@eslint/eslintrc";
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
});
const eslintConfig = [
...compat.extends("next/core-web-vitals", "next/typescript", "prettier"),
{
plugins: {
prettier: (await import("eslint-plugin-prettier")).default,
},
rules: {
// 빌드 실패를 방지하기 위한 규칙 완화
"@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/no-explicit-any": "warn",
"react-hooks/exhaustive-deps": "warn",
"@next/next/no-img-element": "warn",
"react/no-unescaped-entities": "warn",
// 기타 자주 발생하는 오류들을 경고로 변경
"prefer-const": "warn",
"no-unused-vars": "off", // TypeScript에서는 @typescript-eslint/no-unused-vars 사용
// Prettier와 일치하는 quote 규칙
quotes: ["warn", "double", { avoidEscape: true }],
semi: ["warn", "always"],
// Prettier 규칙 (Prettier 설정 파일과 일치하도록)
"prettier/prettier": [
"warn",
{
singleQuote: false,
semi: true,
arrowParens: "always",
bracketSpacing: true,
bracketSameLine: false,
jsxSingleQuote: false,
quoteProps: "as-needed",
tabWidth: 2,
printWidth: 120,
trailingComma: "all",
endOfLine: "auto",
},
],
},
},
];
export default eslintConfig;