Update NextJS (#584)

* Update nextjs

* Add eslint config
This commit is contained in:
Eduard Gert
2026-02-02 17:33:09 +01:00
committed by GitHub
parent 858d7e7c9d
commit 766b03cc40
4 changed files with 30 additions and 16 deletions

16
eslint.config.mjs Normal file
View File

@@ -0,0 +1,16 @@
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"),
];
export default eslintConfig;

View File

@@ -19,9 +19,6 @@ const nextConfig = {
assetPrefix: undefined,
reactStrictMode: true,
pageExtensions: ['js', 'jsx', 'ts', 'tsx', 'mdx'],
experimental: {
scrollRestoration: true,
},
redirects: async () => {
return [
{

View File

@@ -3,12 +3,12 @@
"version": "1.0.0",
"private": true,
"scripts": {
"dev": "npm run gen:llm && next dev",
"build": "npm run gen:llm && next build",
"dev": "npm run gen:llm && next dev --webpack",
"build": "npm run gen:llm && next build --webpack",
"gen": "swagger-codegen generate -i https://raw.githubusercontent.com/netbirdio/netbird/main/management/server/http/api/openapi.yml -l openapi -o generator/openapi && npx ts-node generator/index.ts gen --input generator/openapi/openapi.json --output src/pages/ipa/resources",
"gen:llm": "node scripts/generate-llm-docs.mjs",
"start": "next start",
"lint": "next lint"
"lint": "eslint src/"
},
"browserslist": {
"production": [
@@ -30,10 +30,10 @@
"@fortawesome/free-brands-svg-icons": "^6.4.0",
"@fortawesome/free-solid-svg-icons": "^6.4.0",
"@fortawesome/react-fontawesome": "^0.2.0",
"@headlessui/react": "^1.7.13",
"@headlessui/react": "^2.2.0",
"@mdx-js/loader": "^2.1.5",
"@mdx-js/react": "^2.1.5",
"@next/mdx": "^13.4.1",
"@next/mdx": "^16.0.0",
"@sindresorhus/slugify": "^2.1.1",
"@tailwindcss/typography": "^0.5.8",
"acorn": "^8.8.2",
@@ -44,16 +44,16 @@
"crypto-js": "^4.2.0",
"ejs": "^3.1.9",
"focus-visible": "^5.2.0",
"framer-motion": "10.12.9",
"framer-motion": "^11.0.0",
"js-yaml": "^4.1.0",
"lodash": "^4.17.21",
"mdast-util-to-string": "^3.2.0",
"mdx-annotations": "^0.1.1",
"next": "14.2.35",
"next": "^16.0.0",
"openapi-types": "^12.1.0",
"postcss-focus-visible": "^8.0.2",
"react": "18.2.0",
"react-dom": "18.2.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-toastify": "^9.1.3",
"recma-nextjs-static-props": "^1.0.0",
"rehype-mdx-title": "^2.0.0",
@@ -65,8 +65,9 @@
"zustand": "^4.3.8"
},
"devDependencies": {
"eslint": "8.40.0",
"eslint-config-next": "13.4.1",
"@eslint/eslintrc": "^3.0.0",
"eslint": "^9.0.0",
"eslint-config-next": "^16.0.0",
"prettier": "^2.8.7",
"prettier-plugin-tailwindcss": "^0.2.6"
}

View File

@@ -1,6 +1,6 @@
import { NextRequest, NextResponse } from 'next/server';
import { NextResponse } from 'next/server';
export function middleware(req) {
export function proxy(req) {
if (req.nextUrl.href.includes('/docs-static/_next/'))
return NextResponse.rewrite(
req.nextUrl.href.replace('/docs-static/_next/', '/_next/'),