feat: improve reconnect, add ESLint configuration for common and socket

This commit is contained in:
Ralex
2025-10-19 00:37:26 +02:00
parent 8bdb8f47ef
commit 96bff164c0
36 changed files with 1571 additions and 677 deletions

View File

@@ -1,22 +1,23 @@
import js from "@eslint/js"
import nextPlugin from "@next/eslint-plugin-next"
import tsEslintPlugin from "@typescript-eslint/eslint-plugin"
import tsEslintParser from "@typescript-eslint/parser"
import reactPlugin from "eslint-plugin-react"
import reactHooksPlugin from "eslint-plugin-react-hooks"
import { defineConfig } from "eslint/config"
import globals from "globals"
import tseslint from "typescript-eslint"
export default defineConfig([
{
ignores: ["**/node_modules/**", "**/.next/**"],
},
{
files: ["**/*.ts", "**/*.tsx"],
files: ["**/*.{ts,tsx}"],
languageOptions: {
ecmaVersion: "latest",
sourceType: "module",
parser: tsEslintParser,
...js.configs.recommended.languageOptions,
parser: tseslint.parser,
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
ecmaFeatures: { jsx: true },
},
globals: {
@@ -25,7 +26,7 @@ export default defineConfig([
},
},
plugins: {
"@typescript-eslint": tsEslintPlugin,
"@typescript-eslint": tseslint.plugin,
react: reactPlugin,
"react-hooks": reactHooksPlugin,
"@next/next": nextPlugin,
@@ -36,6 +37,10 @@ export default defineConfig([
},
},
rules: {
...js.configs.recommended.rules,
...tseslint.configs.recommendedTypeChecked[0].rules,
...reactPlugin.configs.recommended.rules,
"array-callback-return": [
"error",
{ allowImplicit: false, checkForEach: true, allowVoid: true },
@@ -213,7 +218,7 @@ export default defineConfig([
"space-before-blocks": "error",
semi: ["error", "never"],
// Extra rules
// React + Hooks + Next.js
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "off",
"react/no-unescaped-entities": ["error", { forbid: [">", "}"] }],