mirror of
https://github.com/randyjc/Rahoot.git
synced 2026-03-13 20:15:35 +01:00
feat: improve reconnect, add ESLint configuration for common and socket
This commit is contained in:
@@ -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: [">", "}"] }],
|
||||
|
||||
Reference in New Issue
Block a user