From f53561e603cfc7c5acf0ff8a9a57a2dd833ebb04 Mon Sep 17 00:00:00 2001 From: aoi-dev-0411 Date: Sat, 11 Apr 2026 17:21:34 +0900 Subject: [PATCH] feat: setup ESLint flat config with TypeScript and Next.js rules Closes #28 --- eslint.config.mjs | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 eslint.config.mjs diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..e005ed8 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,30 @@ +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"), + { + rules: { + "no-unused-vars": "off", + "@typescript-eslint/no-unused-vars": [ + "warn", + { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }, + ], + "@typescript-eslint/no-explicit-any": "warn", + "no-console": ["warn", { allow: ["warn", "error"] }], + "prefer-const": "error", + "no-var": "error", + eqeqeq: ["error", "always"], + }, + }, +]; + +export default eslintConfig;