Update ESLint configuration and package dependencies

- Added support for Next.js ESLint plugin and React Hooks in the ESLint configuration.
- Updated package.json to include the latest versions of Next.js and related dependencies.
- Removed outdated ESLint configuration files from the BFF and Portal applications.
- Enhanced .gitignore to exclude additional TypeScript build info files.
- Cleaned up pnpm workspace configuration for better package management.
This commit is contained in:
barsa 2025-12-12 11:02:59 +09:00
parent 17d6b91727
commit 8b1b402814
11 changed files with 75 additions and 1443 deletions

2
.gitignore vendored
View File

@ -83,6 +83,8 @@ jspm_packages/
*.tsbuildinfo *.tsbuildinfo
**/tsconfig.tsbuildinfo **/tsconfig.tsbuildinfo
**/.typecheck/ **/.typecheck/
**/.tsbuildinfo-*
.tsbuildinfo-*
# Optional npm cache directory # Optional npm cache directory
.npm/ .npm/

View File

@ -1,2 +1,3 @@
argon2
prisma prisma
@prisma/engines @prisma/engines

View File

@ -1,24 +0,0 @@
{
"root": true,
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"env": { "es2021": true, "node": true },
"overrides": [
{
"files": ["src/core/**/*.ts"],
"rules": {
"no-restricted-imports": [
"error",
{ "patterns": ["@bff/infra/*", "@bff/modules/*", "@bff/integrations/*"] }
]
}
},
{
"files": ["src/integrations/**/*.ts"],
"rules": {
"no-restricted-imports": ["error", { "patterns": ["@bff/modules/*"] }]
}
}
]
}

File diff suppressed because one or more lines are too long

View File

@ -1,3 +0,0 @@
{
"extends": ["next/core-web-vitals", "next/typescript"]
}

View File

@ -24,7 +24,7 @@
"class-variance-authority": "^0.7.1", "class-variance-authority": "^0.7.1",
"clsx": "^2.1.1", "clsx": "^2.1.1",
"date-fns": "^4.1.0", "date-fns": "^4.1.0",
"next": "16.0.8", "next": "16.0.9",
"react": "19.2.1", "react": "19.2.1",
"react-dom": "19.2.1", "react-dom": "19.2.1",
"tailwind-merge": "^3.4.0", "tailwind-merge": "^3.4.0",
@ -33,7 +33,7 @@
"zustand": "^5.0.9" "zustand": "^5.0.9"
}, },
"devDependencies": { "devDependencies": {
"@next/bundle-analyzer": "^16.0.8", "@next/bundle-analyzer": "^16.0.9",
"@tailwindcss/postcss": "^4.1.17", "@tailwindcss/postcss": "^4.1.17",
"@tanstack/react-query-devtools": "^5.91.1", "@tanstack/react-query-devtools": "^5.91.1",
"@types/react": "^19.2.7", "@types/react": "^19.2.7",

View File

@ -1,13 +0,0 @@
# EditorConfig helps maintain consistent coding styles across editors
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false

View File

@ -1,30 +1,13 @@
/* eslint-env node */ /* eslint-env node */
import process from "node:process"; import process from "node:process";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js"; import js from "@eslint/js";
import nextPlugin from "@next/eslint-plugin-next";
import reactHooks from "eslint-plugin-react-hooks";
import tseslint from "typescript-eslint"; import tseslint from "typescript-eslint";
import prettier from "eslint-plugin-prettier"; import prettier from "eslint-plugin-prettier";
import globals from "globals"; import globals from "globals";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
// Dynamically import Next.js ESLint configs only when needed
async function getNextConfigs() {
try {
const { FlatCompat } = await import("@eslint/eslintrc");
const compat = new FlatCompat({ baseDirectory: path.join(__dirname, "apps/portal") });
return {
coreWebVitals: compat.extends("next/core-web-vitals"),
typescript: compat.extends("next/typescript"),
};
} catch {
return { coreWebVitals: [], typescript: [] };
}
}
const nextConfigs = await getNextConfigs();
export default [ export default [
// Global ignores // Global ignores
{ {
@ -86,15 +69,15 @@ export default [
}, },
}, },
// Next.js app config (only applies to portal files) // Portal (Next.js) rules (flat-config friendly)
...nextConfigs.coreWebVitals.map((config) => ({ {
...config, ...nextPlugin.configs["core-web-vitals"],
files: ["apps/portal/**/*.{js,jsx,ts,tsx}"], files: ["apps/portal/**/*.{js,jsx,ts,tsx}"],
})), },
...nextConfigs.typescript.map((config) => ({ {
...config, ...reactHooks.configs.flat.recommended,
files: ["apps/portal/**/*.{ts,tsx}"], files: ["apps/portal/**/*.{jsx,tsx}"],
})), },
// Portal type-aware rules // Portal type-aware rules
{ {
@ -104,6 +87,7 @@ export default [
projectService: true, projectService: true,
tsconfigRootDir: process.cwd(), tsconfigRootDir: process.cwd(),
}, },
globals: { ...globals.browser, ...globals.node },
}, },
rules: { rules: {
"@next/next/no-html-link-for-pages": "off", "@next/next/no-html-link-for-pages": "off",

View File

@ -50,12 +50,12 @@
"plesk:images": "bash ./scripts/plesk/build-images.sh" "plesk:images": "bash ./scripts/plesk/build-images.sh"
}, },
"devDependencies": { "devDependencies": {
"@eslint/eslintrc": "^3.3.3", "@next/eslint-plugin-next": "16.0.9",
"@eslint/js": "^9.39.1", "@eslint/js": "^9.39.1",
"@types/node": "^24.10.3", "@types/node": "^24.10.3",
"eslint": "^9.39.1", "eslint": "^9.39.1",
"eslint-config-next": "16.0.8",
"eslint-plugin-prettier": "^5.5.4", "eslint-plugin-prettier": "^5.5.4",
"eslint-plugin-react-hooks": "^7.0.1",
"globals": "^16.5.0", "globals": "^16.5.0",
"husky": "^9.1.7", "husky": "^9.1.7",
"prettier": "^3.7.4", "prettier": "^3.7.4",
@ -70,9 +70,6 @@
"typescript": "5.9.3", "typescript": "5.9.3",
"@types/node": "24.10.3", "@types/node": "24.10.3",
"zod": "4.1.13" "zod": "4.1.13"
}, }
"onlyBuiltDependencies": [
"argon2"
]
} }
} }

1419
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,3 @@
packages: packages:
- apps/* - apps/*
- packages/* - packages/*
onlyBuiltDependencies: '[]'