2025-11-06 13:48:11 +09:00
|
|
|
import js from "@eslint/js";
|
|
|
|
|
import nextPlugin from "@next/eslint-plugin-next";
|
|
|
|
|
import tseslint from "@typescript-eslint/eslint-plugin";
|
|
|
|
|
import tsparser from "@typescript-eslint/parser";
|
|
|
|
|
import reactPlugin from "eslint-plugin-react";
|
|
|
|
|
import reactHooksPlugin from "eslint-plugin-react-hooks";
|
2025-11-06 13:33:00 +09:00
|
|
|
|
2025-11-06 13:48:11 +09:00
|
|
|
const eslintConfig = [
|
|
|
|
|
{
|
|
|
|
|
ignores: [
|
|
|
|
|
".next/**",
|
|
|
|
|
"out/**",
|
|
|
|
|
"build/**",
|
|
|
|
|
"dist/**",
|
|
|
|
|
"node_modules/**",
|
|
|
|
|
"next-env.d.ts",
|
2025-11-12 18:09:12 +09:00
|
|
|
"src/components/_unused/**", // Archived unused components
|
2025-11-11 18:55:16 +09:00
|
|
|
"src/hooks/useCurrentTime.ts", // Demo hook
|
2025-11-06 13:48:11 +09:00
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
js.configs.recommended,
|
|
|
|
|
{
|
|
|
|
|
files: ["**/*.{js,jsx,mjs}"],
|
|
|
|
|
plugins: {
|
|
|
|
|
"@next/next": nextPlugin,
|
|
|
|
|
"react": reactPlugin,
|
|
|
|
|
"react-hooks": reactHooksPlugin,
|
|
|
|
|
},
|
|
|
|
|
rules: {
|
|
|
|
|
...nextPlugin.configs.recommended.rules,
|
|
|
|
|
...nextPlugin.configs["core-web-vitals"].rules,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
files: ["**/*.{ts,tsx}"],
|
|
|
|
|
languageOptions: {
|
|
|
|
|
parser: tsparser,
|
|
|
|
|
parserOptions: {
|
|
|
|
|
ecmaVersion: "latest",
|
|
|
|
|
sourceType: "module",
|
|
|
|
|
ecmaFeatures: {
|
|
|
|
|
jsx: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
globals: {
|
|
|
|
|
React: "readonly",
|
|
|
|
|
console: "readonly",
|
|
|
|
|
process: "readonly",
|
|
|
|
|
__dirname: "readonly",
|
|
|
|
|
__filename: "readonly",
|
|
|
|
|
Buffer: "readonly",
|
2025-11-06 20:22:22 +09:00
|
|
|
localStorage: "readonly",
|
|
|
|
|
window: "readonly",
|
|
|
|
|
document: "readonly",
|
|
|
|
|
HTMLButtonElement: "readonly",
|
|
|
|
|
HTMLInputElement: "readonly",
|
2025-11-10 17:25:56 +09:00
|
|
|
fetch: "readonly",
|
|
|
|
|
URL: "readonly",
|
|
|
|
|
RequestInit: "readonly",
|
|
|
|
|
Response: "readonly",
|
|
|
|
|
PageTransitionEvent: "readonly",
|
2025-11-11 18:55:16 +09:00
|
|
|
setTimeout: "readonly",
|
|
|
|
|
clearTimeout: "readonly",
|
|
|
|
|
setInterval: "readonly",
|
|
|
|
|
clearInterval: "readonly",
|
2025-11-18 14:17:52 +09:00
|
|
|
alert: "readonly",
|
|
|
|
|
confirm: "readonly",
|
|
|
|
|
File: "readonly",
|
|
|
|
|
FormData: "readonly",
|
|
|
|
|
URLSearchParams: "readonly",
|
|
|
|
|
HeadersInit: "readonly",
|
|
|
|
|
HTMLTableElement: "readonly",
|
|
|
|
|
HTMLTableSectionElement: "readonly",
|
|
|
|
|
HTMLTableRowElement: "readonly",
|
|
|
|
|
HTMLTableCellElement: "readonly",
|
|
|
|
|
HTMLTableCaptionElement: "readonly",
|
|
|
|
|
HTMLTextAreaElement: "readonly",
|
|
|
|
|
HTMLCanvasElement: "readonly",
|
|
|
|
|
ImageData: "readonly",
|
|
|
|
|
Image: "readonly",
|
|
|
|
|
prompt: "readonly",
|
2025-11-06 13:48:11 +09:00
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
plugins: {
|
|
|
|
|
"@typescript-eslint": tseslint,
|
|
|
|
|
"@next/next": nextPlugin,
|
|
|
|
|
"react": reactPlugin,
|
|
|
|
|
"react-hooks": reactHooksPlugin,
|
|
|
|
|
},
|
|
|
|
|
rules: {
|
|
|
|
|
...tseslint.configs.recommended.rules,
|
|
|
|
|
...nextPlugin.configs.recommended.rules,
|
|
|
|
|
...nextPlugin.configs["core-web-vitals"].rules,
|
|
|
|
|
"react/react-in-jsx-scope": "off",
|
|
|
|
|
"@typescript-eslint/no-explicit-any": "warn",
|
|
|
|
|
"@typescript-eslint/no-unused-vars": ["error", {
|
|
|
|
|
"argsIgnorePattern": "^_",
|
|
|
|
|
"varsIgnorePattern": "^_"
|
|
|
|
|
}],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
];
|
2025-11-06 13:33:00 +09:00
|
|
|
|
|
|
|
|
export default eslintConfig;
|