diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index b13ab05..0000000 --- a/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -src/styled-system \ No newline at end of file diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index fb761d9..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "env": { - "browser": true, - "es2021": true, - "node": true - }, - "extends": [ - "next/core-web-vitals", - "standard-with-typescript", - "plugin:react/recommended" - ], - "parserOptions": { - "ecmaVersion": "latest", - "sourceType": "module" - }, - "plugins": [ - "react" - ], - "rules": { - "react/react-in-jsx-scope": "off", - "react/jsx-uses-react": "off", - "indent": "off", - "@typescript-eslint/indent": [ - "error", - 2, - { - "SwitchCase": 1 - } - ], - "react/jsx-indent": [ - "error", - 2 - ], - "no-use-before-define": "off", - "@typescript-eslint/no-use-before-define": [ - "error" - ], - "no-unused-vars": "off", - "@typescript-eslint/no-unused-vars": [ - "error", - { - "argsIgnorePattern": "^_" - } - ], - "react-hooks/exhaustive-deps": "off", - "react/no-unknown-property": [ - "error", - { - "ignore": [ - "css" - ] - } - ] - } -} \ No newline at end of file diff --git a/bun.lockb b/bun.lockb index 9406c5d..666e395 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/ecosystem.config.js b/ecosystem.config.js index 268312d..1484735 100644 --- a/ecosystem.config.js +++ b/ecosystem.config.js @@ -19,13 +19,13 @@ module.exports = { deploy: { production: { - user: process.env.SSH_USERNAME, - host: process.env.DEPLOY_HOST, - ref: 'origin/production', - repo: 'https://github.com/SrJuggernaut/entgamers_pro', - path: process.env.DEPLOY_PATH, + 'user': process.env.SSH_USERNAME, + 'host': process.env.DEPLOY_HOST, + 'ref': 'origin/production', + 'repo': 'https://github.com/SrJuggernaut/entgamers_pro', + 'path': process.env.DEPLOY_PATH, 'post-deploy': 'pm2 --silent startOrRestart ecosystem.config.js', - env: { + 'env': { PORT: process.env.PORT, NEXT_PUBLIC_APPWRITE_ENDPOINT: process.env.NEXT_PUBLIC_APPWRITE_ENDPOINT, NEXT_PUBLIC_APPWRITE_PROJECT_ID: process.env.NEXT_PUBLIC_APPWRITE_PROJECT_ID, @@ -37,13 +37,13 @@ module.exports = { }, preview: { - user: process.env.SSH_USERNAME, - host: process.env.DEPLOY_HOST, - ref: 'origin/preview', - repo: 'https://github.com/SrJuggernaut/entgamers_pro', - path: process.env.DEPLOY_PATH, + 'user': process.env.SSH_USERNAME, + 'host': process.env.DEPLOY_HOST, + 'ref': 'origin/preview', + 'repo': 'https://github.com/SrJuggernaut/entgamers_pro', + 'path': process.env.DEPLOY_PATH, 'post-deploy': 'pm2 --silent startOrRestart ecosystem.config.js', - env: { + 'env': { PORT: process.env.PORT, NEXT_PUBLIC_APPWRITE_ENDPOINT: process.env.NEXT_PUBLIC_APPWRITE_ENDPOINT, NEXT_PUBLIC_APPWRITE_PROJECT_ID: process.env.NEXT_PUBLIC_APPWRITE_PROJECT_ID, diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..ca2a368 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,98 @@ +import eslintJs from '@eslint/js' +import nextPlugin from '@next/eslint-plugin-next' +import jsxA11yPlugin from 'eslint-plugin-jsx-a11y' +import reactPlugin from 'eslint-plugin-react' +import reactHooksPlugin from 'eslint-plugin-react-hooks' +import { defineConfig, globalIgnores } from 'eslint/config' +import globals from 'globals' +import tseslint from 'typescript-eslint' +import stylisticPlugin from '@stylistic/eslint-plugin' + +export default defineConfig([ + globalIgnores([ + 'node_modules/', + 'public/', 'src/styled-system/**/*', '.next/**', + 'out/**', + 'build/**', + 'next-env.d.ts']), + + { + name: 'entgamers_pro/globals', + languageOptions: { + globals: { + ...globals.browser, + ...globals.node + } + } + }, + { + name: 'project/eslint-js', + files: ['**/*.{js,mjs,ts,tsx}'], + ...eslintJs.configs.recommended + }, + { + name: 'project/typescript', + files: ['**/*.{ts,tsx}'], + extends: [ + ...tseslint.configs.recommended + ], + rules: { + '@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }] + } + }, + { + name: 'project/react-next', + files: ['**/*.{jsx,tsx}'], + plugins: { + 'react': reactPlugin, + 'react-hooks': reactHooksPlugin, + 'jsx-a11y': jsxA11yPlugin, + '@next/next': nextPlugin + }, + rules: { + ...reactPlugin.configs.recommended.rules, + ...reactPlugin.configs['jsx-runtime'].rules, + ...reactHooksPlugin.configs['recommended-latest'].rules, + ...jsxA11yPlugin.configs.strict.rules, + ...nextPlugin.configs.recommended.rules, + ...nextPlugin.configs['core-web-vitals'].rules, + 'react/react-in-jsx-scope': 'off', + 'react/prop-types': 'off', + 'react/no-unknown-property': 'off', + 'react/jsx-no-target-blank': 'off', + 'jsx-a11y/alt-text': ['warn', { elements: ['img'], img: ['Image'] }], + 'jsx-a11y/media-has-caption': 'warn' + }, + settings: { + react: { + version: '19' + } + } + }, + { + name: 'project/stylistic', + files: ['**/*.{js,mjs,ts,tsx}'], + plugins: { + '@stylistic': stylisticPlugin + }, + rules: { + // Remove legacy formatting rules from ESLint core + ...stylisticPlugin.configs['disable-legacy'].rules, + // Add recommended stylistic rules + ...stylisticPlugin.configs.recommended.rules, + '@stylistic/indent': ['warn', 2], + '@stylistic/quotes': ['warn', 'single', { + avoidEscape: true, + allowTemplateLiterals: 'always' + }], + '@stylistic/semi': ['warn', 'never'], + '@stylistic/comma-dangle': ['warn', 'never'], + '@stylistic/arrow-parens': ['warn', 'always', { + requireForBlockBody: true + }], + '@stylistic/brace-style': ['warn', '1tbs', { + allowSingleLine: true + }] + } + } +]) diff --git a/next-env.d.ts b/next-env.d.ts index 4f11a03..9edff1c 100644 --- a/next-env.d.ts +++ b/next-env.d.ts @@ -1,5 +1,6 @@ /// /// +import "./.next/types/routes.d.ts"; // NOTE: This file should not be edited -// see https://nextjs.org/docs/basic-features/typescript for more information. +// see https://nextjs.org/docs/app/api-reference/config/typescript for more information. diff --git a/next.config.js b/next.config.js index f7de370..fd4b21e 100644 --- a/next.config.js +++ b/next.config.js @@ -1,4 +1,4 @@ -const imageDomains = (process.env.IMAGE_DOMAINS ?? '').split(',').map(domain => { +const imageDomains = (process.env.IMAGE_DOMAINS ?? '').split(',').map((domain) => { const getDataRegex = /(?[\w]+)?:\/\/(?[\w.-]+)?((?<=[\d]{0,4}):(?[\d]{0,4}))?\/?(?.*)?$/ const groups = getDataRegex.exec(domain).groups ?? {} return groups diff --git a/package.json b/package.json index a7958a7..42e0164 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "build": "next build", "prestart": "bun install && next build", "start": "next start", - "lint": "next lint", + "lint": "eslint .", "prepare": "panda codegen && husky install" }, "dependencies": { @@ -18,6 +18,7 @@ "@fortawesome/free-solid-svg-icons": "^6.5.1", "@fortawesome/react-fontawesome": "^0.2.0", "@reduxjs/toolkit": "^2.0.1", + "@stylistic/eslint-plugin": "^5.10.0", "@tanstack/match-sorter-utils": "^8.11.8", "@tanstack/react-table": "^8.19.3", "appwrite": "^13.0.1", @@ -25,12 +26,12 @@ "entgamers-database": "0.0.26", "entgamers-panda-preset": "0.1.5", "formik": "^2.4.5", - "framer-motion": "^10.17.6", + "framer-motion": "^12.38.0", "isomorphic-fetch": "^3.0.0", - "next": "^14.0.4", + "next": "16.2.2", "node-appwrite": "^11.1.0", - "react": "18.2.0", - "react-dom": "18.2.0", + "react": "19.2.4", + "react-dom": "19.2.4", "react-redux": "^9.0.4", "sharp": "^0.33.1", "yup": "^1.3.3" @@ -38,23 +39,17 @@ "devDependencies": { "@commitlint/cli": "^18.4.4", "@commitlint/config-conventional": "^18.4.4", + "@eslint/js": "^10.0.1", "@pandacss/dev": "^0.23.0", "@types/isomorphic-fetch": "^0.0.39", "@types/node": "^20.10.6", - "@types/react": "^18.2.46", - "@types/react-dom": "^18.2.18", - "@typescript-eslint/eslint-plugin": "^6.4.0", - "@typescript-eslint/parser": "^5.38.0", - "eslint": "^8.0.1", - "eslint-config-next": "latest", - "eslint-config-standard": "^17.0.0", - "eslint-config-standard-with-typescript": "latest", - "eslint-plugin-import": "^2.25.2", - "eslint-plugin-n": "^15.0.0 || ^16.0.0 ", - "eslint-plugin-node": "^11.1.0", - "eslint-plugin-promise": "^6.0.0", - "eslint-plugin-react": "latest", + "@types/react": "19.2.14", + "@types/react-dom": "19.2.3", + "eslint": "^10.1.0", + "eslint-config-next": "16.2.2", + "eslint-plugin-react": "^7.37.5", "husky": "^8.0.3", - "typescript": "*" + "typescript": "*", + "typescript-eslint": "^8.58.0" } -} \ No newline at end of file +} diff --git a/src/app/Clanes.tsx b/src/app/Clanes.tsx index e718ca0..fc43267 100644 --- a/src/app/Clanes.tsx +++ b/src/app/Clanes.tsx @@ -22,7 +22,7 @@ const Clanes: FC = () => {
- Clanes + Clanes
{ - const { alerts } = useAppSelector(state => state.feedback) + const { alerts } = useAppSelector((state) => state.feedback) const dispatch = useAppDispatch() return ( <> @@ -55,7 +55,7 @@ const FeedbackConsumer: FC = () => { className={alert().closeButton} onClick={() => dispatch(removeAlert(currentAlert.id))} > - + {currentAlert.title} diff --git a/src/app/Hero.tsx b/src/app/Hero.tsx index 43c1bc1..a152ed2 100644 --- a/src/app/Hero.tsx +++ b/src/app/Hero.tsx @@ -111,20 +111,20 @@ const Hero: FC = () => { color: 'primary', size: 'large' }), css({ - position: 'absolute', - bottom: '45px', - right: '50%', - animationName: 'bounce', - animationDuration: '1s', - animationIterationCount: 'infinite', - transform: 'translateX(50%)', - zIndex: 1, + 'position': 'absolute', + 'bottom': '45px', + 'right': '50%', + 'animationName': 'bounce', + 'animationDuration': '1s', + 'animationIterationCount': 'infinite', + 'transform': 'translateX(50%)', + 'zIndex': 1, '&:hover': { animationPlayState: 'paused' } }))} > - + ) diff --git a/src/app/SessionConsumer.tsx b/src/app/SessionConsumer.tsx index 6c60c0a..ec4d9a6 100644 --- a/src/app/SessionConsumer.tsx +++ b/src/app/SessionConsumer.tsx @@ -5,15 +5,14 @@ import { setClanes, setCurrentUser, setSession, setStatus } from '@/state/sessio import { AppwriteException } from 'appwrite' import { getClanes } from 'entgamers-database/frontend/clanes' import { getCurrentUser, getSession } from 'entgamers-database/frontend/session' -import { useCallback, useEffect, type FC } from 'react' +import { useCallback, useEffect } from 'react' -const SessionConsumer: FC = () => { +const SessionConsumer = () => { const { status, session, user, clanes } = useAppSelector((state) => state.session) const dispatch = useAppDispatch() const ensureSession = useCallback(async () => { try { - if (status !== 'initializing' || session !== undefined) return dispatch(setStatus('loading')) const currentSession = await getSession('current') const currentUser = await getCurrentUser() @@ -26,16 +25,17 @@ const SessionConsumer: FC = () => { } finally { dispatch(setStatus('idle')) } - }, []) + }, [dispatch]) useEffect(() => { + if (status !== 'initializing' || session !== undefined) return ensureSession() .catch((error) => { if (error instanceof AppwriteException) { console.error(error) } }) - }, []) + }, [status, session, ensureSession]) useEffect(() => { if (user !== undefined && clanes === undefined) { @@ -51,11 +51,6 @@ const SessionConsumer: FC = () => { } else if (user === undefined && clanes !== undefined) { dispatch(setClanes()) } - }, [user]) - - return ( - <> - - ) + }, [user, clanes, dispatch]) } export default SessionConsumer diff --git a/src/app/Social.tsx b/src/app/Social.tsx index 35f2364..24c95ff 100644 --- a/src/app/Social.tsx +++ b/src/app/Social.tsx @@ -52,7 +52,7 @@ const Social: FC = () => {
- Redes Sociales + Redes Sociales Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptate deleniti dolore quas sed nemo sit, officia in rem nesciunt quisquam possimus ab! Labore sed reprehenderit quae, hic earum tempora placeat cumque id eos itaque perferendis nulla officia fuga porro, quis, unde facere accusamus repudiandae non? diff --git a/src/app/clanes/page.tsx b/src/app/clanes/page.tsx index ac7e6c2..67da2b9 100644 --- a/src/app/clanes/page.tsx +++ b/src/app/clanes/page.tsx @@ -21,37 +21,68 @@ const ClanesPage: FC = () => { Beneficios de los clanes La intención de EntGamers es brindar beneficios a los clanes que les permitan operar en un ambiente de comunicación y colaboración.
    -
  • Espacio en el servidor de Discord.
  • -
  • Apoyo de la administración con proyectos y eventos.
  • -
  • Apoyo del equipo de moderación.
  • +
  • + + {' '} + Espacio en el servidor de Discord. +
  • +
  • + + {' '} + Apoyo de la administración con proyectos y eventos. +
  • +
  • + + {' '} + Apoyo del equipo de moderación. +
Requisitos para formar un clan Todos los clanes deben cumplir con los siguientes requisitos:
    -
  • Tener un encargado.
  • -
  • Fomentar el compañerismo y la comunidad.
  • -
  • Aportar contenido de forma periódica para la comunidad.
  • -
  • Realizar al menos una actividad mensual con los integrantes.
  • +
  • + + {' '} + Tener un encargado. +
  • +
  • + + {' '} + Fomentar el compañerismo y la comunidad. +
  • +
  • + + {' '} + Aportar contenido de forma periódica para la comunidad. +
  • +
  • + + {' '} + Realizar al menos una actividad mensual con los integrantes. +
Clanes activos
- Esta sección está en construcción. Puedes ver los clanes activos en nuestro Servidor de Discord. + Esta sección está en construcción. Puedes ver los clanes activos en nuestro + {' '} + Servidor de Discord + .
) diff --git a/src/app/cuenta/CuentaTabs.tsx b/src/app/cuenta/CuentaTabs.tsx index 8c2690e..e204fdf 100644 --- a/src/app/cuenta/CuentaTabs.tsx +++ b/src/app/cuenta/CuentaTabs.tsx @@ -44,7 +44,7 @@ const CuentaTabs: FC = () => { > {currentTab === 'login' && ( { initial={{ opacity: 0, x: '-100%' }} animate={{ opacity: 1, x: 0 }} exit={{ opacity: 0, x: '100%' }} - key="login"> + key="login" + > @@ -63,7 +64,8 @@ const CuentaTabs: FC = () => { initial={{ opacity: 0, x: '-100%' }} animate={{ opacity: 1, x: 0 }} exit={{ opacity: 0, x: '100%' }} - key="perfil"> + key="perfil" + > diff --git a/src/app/cuenta/UpdateUserName.tsx b/src/app/cuenta/UpdateUserName.tsx index a69a1d5..51b408d 100644 --- a/src/app/cuenta/UpdateUserName.tsx +++ b/src/app/cuenta/UpdateUserName.tsx @@ -68,7 +68,7 @@ const UpdateUserName: FC = () => { }) .catch(console.error) } - }, [status, session, user]) + }, [status, session, user, formik]) if (status !== 'idle' || session === undefined) { // TODO: Replace with Skeleton @@ -99,8 +99,7 @@ const UpdateUserName: FC = () => { {formik.errors.name} )} - +