Skip to content

Commit 9b2c086

Browse files
chore: update node to 24 (#75)
1 parent 254af10 commit 9b2c086

10 files changed

Lines changed: 3425 additions & 3682 deletions

File tree

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:22-alpine AS base
1+
FROM node:24-alpine AS base
22

33
FROM base AS deps
44
WORKDIR /app

apps/statgpt-admin-frontend/jest.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-disable */
2-
export default {
2+
module.exports = {
33
displayName: 'statgpt-admin-frontend',
44
preset: '../../jest.preset.js',
55
transform: {

apps/statgpt-admin-frontend/next.config.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,7 @@ const { composePlugins, withNx } = require('@nx/next');
2323
* @type {import('@nx/next/plugins/with-nx').WithNxOptions}
2424
**/
2525
const nextConfig = {
26-
nx: {
27-
// Set this to true if you would like to use SVGR
28-
// See: https://github.com/gregberge/svgr
29-
svgr: false,
30-
},
26+
nx: {},
3127
poweredByHeader: false,
3228
async headers() {
3329
return [

apps/statgpt-admin-frontend/src/app/layout.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1+
import { Inter } from 'next/font/google';
12
import { cookies, headers } from 'next/headers';
23
import { redirect } from 'next/navigation';
3-
import { Inter } from 'next/font/google';
44

55
import { Header } from '@/src/components/Header/Header';
66
import { MenuSideBar } from '@/src/components/Menu/Menu';
77
import { SIGN_IN_LINK } from '@/src/constants/auth';
88
import { NotificationProvider } from '@/src/context/NotificationContext';
99
import { getIsInvalidSession, getUserToken } from '@/src/utils/auth/get-token';
1010
import { getIsEnableAuthToggle } from '@/src/utils/get-auth-toggle';
11-
import { NextAuthProvider } from './provider';
11+
import { ReactNode } from 'react';
1212
import './global.scss';
13+
import { NextAuthProvider } from './provider';
1314

1415
export const metadata = {
1516
title: 'StatGPT Admin',
@@ -24,7 +25,7 @@ const inter = Inter({
2425
export default async function RootLayout({
2526
children,
2627
}: {
27-
children: React.ReactNode;
28+
children: ReactNode;
2829
}) {
2930
const isEnableAuth = getIsEnableAuthToggle();
3031
const token = await getUserToken(isEnableAuth, headers(), cookies());

apps/statgpt-admin-frontend/src/components/BaseComponents/DropdownField/DropdownField.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ import { DropdownProps } from './DropdownComponent';
99
import { DropdownMenuItem } from './DropdownItem';
1010

1111
interface Props
12-
extends InputFieldBaseProps,
13-
Omit<DropdownProps, 'selectedValue'> {
12+
extends InputFieldBaseProps, Omit<DropdownProps, 'selectedValue'> {
1413
items: DropdownItemsModel[];
1514
selectedValue?: string;
1615
onChange: (value: string) => void;

eslint.config.mjs

Lines changed: 53 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,60 @@
1-
import { defineConfig, globalIgnores } from 'eslint/config';
1+
import js from '@eslint/js';
2+
import tsParser from '@typescript-eslint/parser';
3+
import tsPlugin from '@typescript-eslint/eslint-plugin';
24
import nx from '@nx/eslint-plugin';
35
import globals from 'globals';
4-
import tsParser from '@typescript-eslint/parser';
5-
import path from 'node:path';
6-
import { fileURLToPath } from 'node:url';
7-
import js from '@eslint/js';
8-
import { FlatCompat } from '@eslint/eslintrc';
9-
10-
const __filename = fileURLToPath(import.meta.url);
11-
const __dirname = path.dirname(__filename);
12-
const compat = new FlatCompat({
13-
baseDirectory: __dirname,
14-
recommendedConfig: js.configs.recommended,
15-
allConfig: js.configs.all,
16-
});
6+
import jsxA11yPlugin from 'eslint-plugin-jsx-a11y';
7+
import reactPlugin from 'eslint-plugin-react';
8+
import reactHooksPlugin from 'eslint-plugin-react-hooks';
9+
import nextPlugin from '@next/eslint-plugin-next';
10+
import prettierPlugin from 'eslint-plugin-prettier';
1711

18-
export default defineConfig([
19-
globalIgnores([
20-
'**/node_modules',
21-
'**/next',
22-
'**/.next',
23-
'**/**.config.js',
24-
'**/**.config.mjs',
25-
'**/jest.config.ts',
26-
'**/**.spec.ts',
27-
'**/**.d.ts',
28-
'**/**.spec.tsx',
29-
]),
12+
export default [
3013
{
31-
extends: compat.extends('eslint:recommended', 'prettier', 'next'),
32-
33-
plugins: {
34-
'@nx': nx,
35-
},
36-
14+
ignores: [
15+
'**/node_modules',
16+
'**/next',
17+
'**/.next',
18+
'**/next-env.d.ts',
19+
'**/**.config.js',
20+
'**/**.config.mjs',
21+
'**/jest.config.ts',
22+
'**/**.spec.ts',
23+
'**/**.spec.tsx',
24+
],
25+
},
26+
{
27+
files: ['**/*.{ts,tsx,js,jsx}'],
3728
languageOptions: {
38-
globals: {
39-
...globals.node,
40-
},
41-
4229
parser: tsParser,
4330
ecmaVersion: 5,
4431
sourceType: 'commonjs',
45-
4632
parserOptions: {
4733
project: ['tsconfig.*?.json'],
4834
},
35+
globals: {
36+
...globals.browser,
37+
...globals.node,
38+
globalThis: 'readonly',
39+
NodeJS: 'readonly',
40+
},
41+
},
42+
plugins: {
43+
'@nx': nx,
44+
react: reactPlugin,
45+
prettier: prettierPlugin,
46+
'@typescript-eslint': tsPlugin,
47+
'react-hooks': reactHooksPlugin,
48+
'jsx-a11y': jsxA11yPlugin,
49+
'@next/next': nextPlugin,
4950
},
50-
},
51-
{
52-
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
5351
rules: {
52+
...js.configs.recommended.rules,
53+
...tsPlugin.configs.recommended.rules,
54+
...nextPlugin.configs.recommended.rules,
55+
...prettierPlugin.configs.recommended.rules,
5456
'@next/next/no-html-link-for-pages': 'off',
57+
'no-redeclare': 'off',
5558
'@typescript-eslint/triple-slash-reference': 'off',
5659
'@nx/enforce-module-boundaries': [
5760
'error',
@@ -68,16 +71,9 @@ export default defineConfig([
6871
],
6972
},
7073
],
71-
74+
'no-console': ['error', { allow: ['warn', 'error', 'info'] }],
7275
'no-empty': 'error',
7376

74-
'no-console': [
75-
'error',
76-
{
77-
allow: ['warn', 'error', 'info'],
78-
},
79-
],
80-
8177
'no-constant-condition': 'error',
8278

8379
'no-multiple-empty-lines': [
@@ -87,19 +83,6 @@ export default defineConfig([
8783
maxBOF: 0,
8884
},
8985
],
90-
},
91-
},
92-
{
93-
files: ['**/*.ts', '**/*.tsx'],
94-
95-
extends: compat.extends(
96-
'plugin:@nx/typescript',
97-
'plugin:@typescript-eslint/recommended',
98-
'plugin:@typescript-eslint/stylistic',
99-
'plugin:prettier/recommended',
100-
),
101-
102-
rules: {
10386
'@typescript-eslint/no-unused-vars': [
10487
'error',
10588
{
@@ -110,11 +93,14 @@ export default defineConfig([
11093

11194
'@typescript-eslint/no-explicit-any': 'warn',
11295
'prettier/prettier': 'error',
96+
97+
'no-multiple-empty-lines': [
98+
'warn',
99+
{
100+
max: 1,
101+
maxBOF: 0,
102+
},
103+
],
113104
},
114105
},
115-
{
116-
files: ['**/*.js', '**/*.jsx'],
117-
extends: compat.extends('plugin:@nx/javascript'),
118-
rules: {},
119-
},
120-
]);
106+
];

jest.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { getJestProjectsAsync } from '@nx/jest';
1+
const { getJestProjectsAsync } = require('@nx/jest');
22

3-
export default async () => ({
3+
module.exports = async () => ({
44
projects: await getJestProjectsAsync(),
55
});

0 commit comments

Comments
 (0)