From fec463c6f14a9a11240293c593ab7b213b51c54c Mon Sep 17 00:00:00 2001 From: Nevo David Date: Tue, 6 May 2025 21:25:25 +0700 Subject: [PATCH] feat: different eslint --- .eslintrc.json | 11 ----------- eslint.config.mjs | 27 +++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 11 deletions(-) delete mode 100644 .eslintrc.json create mode 100644 eslint.config.mjs diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index d5283365..00000000 --- a/.eslintrc.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "root": true, - "extends": ["next/core-web-vitals"], - "rules": { - "@typescript-eslint/no-non-null-asserted-optional-chain": "off", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/ban-ts-comment": "off", - "react/display-name": "off", - "@typescript-eslint/no-unused-vars": "off" - } -} diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 00000000..746467c9 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,27 @@ +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.config({ + extends: ["next/core-web-vitals", "next/typescript"], + rules: { + "react/no-unescaped-entities": "off", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-unused-vars": "off", + "react/display-name": "off", + "@typescript-eslint/ban-ts-comment": "off", + "@typescript-eslint/no-empty-object-type": "off", + "@typescript-eslint/prefer-as-const": "off", + }, + }), +]; + +export default eslintConfig;