diff --git a/app/.prettierrc.json b/app/.prettierrc.json
index 1db2a8cf..72e17590 100644
--- a/app/.prettierrc.json
+++ b/app/.prettierrc.json
@@ -11,4 +11,4 @@
"bracketSameLine": false,
"arrowParens": "always",
"endOfLine": "auto"
-}
\ No newline at end of file
+}
diff --git a/app/eslint.config.js b/app/eslint.config.js
index 42d7beb0..805ec2df 100644
--- a/app/eslint.config.js
+++ b/app/eslint.config.js
@@ -56,11 +56,11 @@ export default tseslint.config(
},
},
plugins: {
- 'react': react,
+ react: react,
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
'import-x': importXPlugin,
- 'promise': promisePlugin,
+ promise: promisePlugin,
'no-catch-all': noCatchAllPlugin,
},
settings: {
@@ -81,11 +81,11 @@ export default tseslint.config(
// Basic rules
'no-console': 'error',
'no-debugger': 'error',
- 'camelcase': 'error',
+ camelcase: 'error',
// Standard JS rules (replacing eslint-config-standard)
- 'semi': ['error', 'never'],
- 'quotes': ['error', 'single', { avoidEscape: true }],
+ semi: ['error', 'never'],
+ quotes: ['error', 'single', { avoidEscape: true }],
'comma-dangle': ['error', 'always-multiline'],
// Disabled: conflicts with common TypeScript/React patterns
// 'space-before-function-paren': ['error', 'always'],
@@ -102,7 +102,7 @@ export default tseslint.config(
'linebreak-style': ['error', 'unix'],
// Additional standard rules that were missing
- 'eqeqeq': ['error', 'always', { null: 'ignore' }],
+ eqeqeq: ['error', 'always', { null: 'ignore' }],
'new-cap': ['error', { newIsCap: true, capIsNew: false, properties: true }],
'array-callback-return': ['error', { allowImplicit: false, checkForEach: false }],
@@ -151,7 +151,16 @@ export default tseslint.config(
'import-x/order': [
'error',
{
- groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object', 'type'],
+ groups: [
+ 'builtin',
+ 'external',
+ 'internal',
+ 'parent',
+ 'sibling',
+ 'index',
+ 'object',
+ 'type',
+ ],
'newlines-between': 'always',
alphabetize: {
order: 'asc',
@@ -222,10 +231,13 @@ export default tseslint.config(
'@typescript-eslint/no-empty-function': 'off',
// Configure no-unused-expressions to allow logical AND and ternary patterns
- '@typescript-eslint/no-unused-expressions': ['error', {
- allowShortCircuit: true,
- allowTernary: true,
- }],
+ '@typescript-eslint/no-unused-expressions': [
+ 'error',
+ {
+ allowShortCircuit: true,
+ allowTernary: true,
+ },
+ ],
},
},
diff --git a/app/src/ModalContent.tsx b/app/src/ModalContent.tsx
index 96232cc8..49efa903 100644
--- a/app/src/ModalContent.tsx
+++ b/app/src/ModalContent.tsx
@@ -22,7 +22,9 @@ export function Welcome1({ clickAction1, map }: ChapterProps) {
@@ -45,7 +47,9 @@ export function Welcome1({ clickAction1, map }: ChapterProps) {
diff --git a/app/src/api/directus.ts b/app/src/api/directus.ts
index 59ee6642..2e28ed01 100644
--- a/app/src/api/directus.ts
+++ b/app/src/api/directus.ts
@@ -86,9 +86,10 @@ export const authLocalStorage = (mainKey = 'directus_storage') =>
// implementation of set, here set the value at mainKey in localStorage, or remove it if value is null
set: async (value: AuthenticationData | null) => {
if (!value) {
- return window.localStorage.removeItem(mainKey)
+ window.localStorage.removeItem(mainKey)
+ return
}
- return window.localStorage.setItem(mainKey, JSON.stringify(value))
+ window.localStorage.setItem(mainKey, JSON.stringify(value))
},
}) as AuthenticationStorage
diff --git a/app/src/api/itemsApi.ts b/app/src/api/itemsApi.ts
index defb7c99..ef964e9b 100644
--- a/app/src/api/itemsApi.ts
+++ b/app/src/api/itemsApi.ts
@@ -20,8 +20,8 @@ export class itemsApi
implements ItemsApi {
constructor(
collectionName: keyof MyCollections,
- layerId?: string | undefined,
- mapId?: string | undefined,
+ layerId?: string,
+ mapId?: string,
filter?: any,
customParameter?: any,
) {
diff --git a/app/src/api/userApi.ts b/app/src/api/userApi.ts
index c6c6c586..ff8e7744 100644
--- a/app/src/api/userApi.ts
+++ b/app/src/api/userApi.ts
@@ -53,7 +53,8 @@ export class UserApi {
async logout(): Promise {
try {
- return await directusClient.logout()
+ await directusClient.logout()
+ return
} catch (error: any) {
console.log(error)
if (error.errors[0].message) throw error.errors[0].message
@@ -97,7 +98,8 @@ export class UserApi {
async requestPasswordReset(email: string, reset_url?: string): Promise {
try {
- return await directusClient.request(passwordRequest(email, reset_url))
+ await directusClient.request(passwordRequest(email, reset_url))
+ return
} catch (error: any) {
console.log(error)
if (error.errors[0].message) throw error.errors[0].message
@@ -107,7 +109,8 @@ export class UserApi {
async passwordReset(reset_token: string, new_password: string): Promise {
try {
- return await directusClient.request(passwordReset(reset_token, new_password))
+ await directusClient.request(passwordReset(reset_token, new_password))
+ return
} catch (error: any) {
console.log(error)
if (error.errors[0].message) throw error.errors[0].message
diff --git a/app/tsconfig.json b/app/tsconfig.json
index 95a0cf49..784becfb 100644
--- a/app/tsconfig.json
+++ b/app/tsconfig.json
@@ -12,35 +12,17 @@
"noFallthroughCasesInSwitch": true,
"baseUrl": ".",
"paths": {
- "@/*": [
- "src/*"
- ],
- "utopia-ui": [
- "../lib/src"
- ],
- "#components/*": [
- "../lib/src/Components/*"
- ],
- "#utils/*": [
- "../lib/src/Utils/*"
- ],
- "#types/*": [
- "../lib/src/types/*"
- ],
- "#assets/*": [
- "../lib/src/assets/*"
- ],
- "#src/*": [
- "../lib/src/*"
- ],
- "#root/*": [
- "../lib/*"
- ]
+ "@/*": ["src/*"],
+ "utopia-ui": ["../lib/src"],
+ "#components/*": ["../lib/src/Components/*"],
+ "#utils/*": ["../lib/src/Utils/*"],
+ "#types/*": ["../lib/src/types/*"],
+ "#assets/*": ["../lib/src/assets/*"],
+ "#src/*": ["../lib/src/*"],
+ "#root/*": ["../lib/*"]
}
},
- "include": [
- "src"
- ],
+ "include": ["src"],
"references": [
{
"path": "./tsconfig.node.json"
diff --git a/lib/.prettierrc.json b/lib/.prettierrc.json
index 1db2a8cf..72e17590 100644
--- a/lib/.prettierrc.json
+++ b/lib/.prettierrc.json
@@ -11,4 +11,4 @@
"bracketSameLine": false,
"arrowParens": "always",
"endOfLine": "auto"
-}
\ No newline at end of file
+}
diff --git a/lib/eslint.config.js b/lib/eslint.config.js
index f6224e1c..855a03ad 100644
--- a/lib/eslint.config.js
+++ b/lib/eslint.config.js
@@ -56,11 +56,11 @@ export default tseslint.config(
},
},
plugins: {
- 'react': react,
+ react: react,
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
'import-x': importXPlugin,
- 'promise': promisePlugin,
+ promise: promisePlugin,
'no-catch-all': noCatchAllPlugin,
},
settings: {
@@ -81,11 +81,11 @@ export default tseslint.config(
// Basic rules
'no-console': 'error',
'no-debugger': 'error',
- 'camelcase': 'error',
+ camelcase: 'error',
// Standard JS rules
- 'semi': ['error', 'never'],
- 'quotes': ['error', 'single', { avoidEscape: true }],
+ semi: ['error', 'never'],
+ quotes: ['error', 'single', { avoidEscape: true }],
'comma-dangle': ['error', 'always-multiline'],
'keyword-spacing': ['error', { before: true, after: true }],
'space-infix-ops': 'error',
@@ -95,9 +95,9 @@ export default tseslint.config(
'array-bracket-spacing': ['error', 'never'],
'computed-property-spacing': ['error', 'never'],
'no-multiple-empty-lines': ['error', { max: 1, maxEOF: 0 }],
- 'indent': ['error', 2],
+ indent: ['error', 2],
'linebreak-style': ['error', 'unix'],
- 'eqeqeq': ['error', 'always', { null: 'ignore' }],
+ eqeqeq: ['error', 'always', { null: 'ignore' }],
'new-cap': ['error', { newIsCap: true, capIsNew: false, properties: true }],
'array-callback-return': ['error', { allowImplicit: false, checkForEach: false }],
@@ -145,7 +145,16 @@ export default tseslint.config(
'import-x/order': [
'error',
{
- groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object', 'type'],
+ groups: [
+ 'builtin',
+ 'external',
+ 'internal',
+ 'parent',
+ 'sibling',
+ 'index',
+ 'object',
+ 'type',
+ ],
'newlines-between': 'always',
alphabetize: { order: 'asc', caseInsensitive: true },
distinctGroup: true,
@@ -155,7 +164,10 @@ export default tseslint.config(
'import-x/no-unused-modules': 'error',
'import-x/no-import-module-exports': 'error',
'import-x/unambiguous': 'off',
- 'import-x/no-relative-parent-imports': ['error', { ignore: ['#[src,types,root,components,utils,assets]/*'] }],
+ 'import-x/no-relative-parent-imports': [
+ 'error',
+ { ignore: ['#[src,types,root,components,utils,assets]/*'] },
+ ],
// Promise rules
'promise/catch-or-return': 'error',
@@ -175,7 +187,6 @@ export default tseslint.config(
// Security and other rules
'no-catch-all/no-catch-all': 'error',
-
},
},
@@ -207,10 +218,13 @@ export default tseslint.config(
'@typescript-eslint/no-empty-function': 'off',
// Configure no-unused-expressions to allow logical AND and ternary patterns
- '@typescript-eslint/no-unused-expressions': ['error', {
- allowShortCircuit: true,
- allowTernary: true,
- }],
+ '@typescript-eslint/no-unused-expressions': [
+ 'error',
+ {
+ allowShortCircuit: true,
+ allowTernary: true,
+ },
+ ],
},
},
@@ -244,4 +258,3 @@ export default tseslint.config(
// Prettier recommended config (should be last to override other formatting rules)
eslintPluginPrettierRecommended,
)
-
diff --git a/lib/src/Components/AppShell/NavBar.tsx b/lib/src/Components/AppShell/NavBar.tsx
index 51f521b9..17eecc01 100644
--- a/lib/src/Components/AppShell/NavBar.tsx
+++ b/lib/src/Components/AppShell/NavBar.tsx
@@ -31,7 +31,9 @@ export default function NavBar({ appName }: { appName: string }) {
className='tw:btn tw:btn-square tw:btn-ghost tw:ml-3'
aria-controls='#sidenav'
aria-haspopup='true'
- onClick={() => toggleSidebar()}
+ onClick={() => {
+ toggleSidebar()
+ }}
>
@@ -50,7 +52,9 @@ export default function NavBar({ appName }: { appName: string }) {
diff --git a/lib/src/Components/AppShell/SideBar.tsx b/lib/src/Components/AppShell/SideBar.tsx
index 4c7d6799..b36aa7aa 100644
--- a/lib/src/Components/AppShell/SideBar.tsx
+++ b/lib/src/Components/AppShell/SideBar.tsx
@@ -57,7 +57,9 @@ export function SideBar({ routes, bottomRoutes }: { routes: Route[]; bottomRoute
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
to={`${route.path}${params && '?' + params.toString()}`}
className={({ isActive }) =>
- `${isActive ? 'tw:font-semibold tw:bg-base-200 tw:rounded-none!' : 'tw:font-normal tw:rounded-none!'}`
+ isActive
+ ? 'tw:font-semibold tw:bg-base-200 tw:rounded-none!'
+ : 'tw:font-normal tw:rounded-none!'
}
onClick={() => {
if (screen.width < 640 && !appState.sideBarSlim) toggleSidebarOpen()
@@ -70,7 +72,7 @@ export function SideBar({ routes, bottomRoutes }: { routes: Route[]; bottomRoute
{route.icon}
{route.name}
@@ -119,7 +121,7 @@ export function SideBar({ routes, bottomRoutes }: { routes: Route[]; bottomRoute
>
{route.icon}
{route.name}
@@ -143,7 +145,9 @@ export function SideBar({ routes, bottomRoutes }: { routes: Route[]; bottomRoute
'tw:w-5 tw:h-5 tw:mb-4 tw:mr-5 tw:mt-2 tw:cursor-pointer tw:float-right tw:delay-400 tw:duration-500 tw:transition-all ' +
(!appState.sideBarSlim ? 'tw:rotate-180' : '')
}
- onClick={() => toggleSidebarSlim()}
+ onClick={() => {
+ toggleSidebarSlim()
+ }}
/>
diff --git a/lib/src/Components/AppShell/SidebarSubmenu.tsx b/lib/src/Components/AppShell/SidebarSubmenu.tsx
index 347d1323..78280787 100644
--- a/lib/src/Components/AppShell/SidebarSubmenu.tsx
+++ b/lib/src/Components/AppShell/SidebarSubmenu.tsx
@@ -31,7 +31,12 @@ function SidebarSubmenu({
return (
{/** Route header */}
-
setIsExpanded(!isExpanded)}>
+
{
+ setIsExpanded(!isExpanded)
+ }}
+ >
{icon}
{name}
setEmail(e.target.value)}
+ onChange={(e) => {
+ setEmail(e.target.value)
+ }}
className='tw:input tw:input-bordered tw:w-full tw:max-w-xs'
/>
setPassword(e.target.value)}
+ onChange={(e) => {
+ setPassword(e.target.value)
+ }}
className='tw:input tw:input-bordered tw:w-full tw:max-w-xs'
/>
diff --git a/lib/src/Components/Auth/RequestPasswordPage.tsx b/lib/src/Components/Auth/RequestPasswordPage.tsx
index dcfb416f..713516c1 100644
--- a/lib/src/Components/Auth/RequestPasswordPage.tsx
+++ b/lib/src/Components/Auth/RequestPasswordPage.tsx
@@ -28,7 +28,7 @@ export function RequestPasswordPage({ resetUrl }: { resetUrl: string }) {
},
error: {
render({ data }) {
- return `${data as string}`
+ return data as string
},
},
pending: 'sending email ...',
@@ -42,7 +42,9 @@ export function RequestPasswordPage({ resetUrl }: { resetUrl: string }) {
type='email'
placeholder='E-Mail'
value={email}
- onChange={(e) => setEmail(e.target.value)}
+ onChange={(e) => {
+ setEmail(e.target.value)
+ }}
className='tw:input tw:input-bordered tw:w-full tw:max-w-xs'
/>
diff --git a/lib/src/Components/Auth/SetNewPasswordPage.tsx b/lib/src/Components/Auth/SetNewPasswordPage.tsx
index c8f59591..fc00649c 100644
--- a/lib/src/Components/Auth/SetNewPasswordPage.tsx
+++ b/lib/src/Components/Auth/SetNewPasswordPage.tsx
@@ -28,7 +28,7 @@ export function SetNewPasswordPage() {
},
error: {
render({ data }) {
- return `${data as string}`
+ return data as string
},
},
pending: 'setting password ...',
@@ -41,7 +41,9 @@ export function SetNewPasswordPage() {
setPassword(e.target.value)}
+ onChange={(e) => {
+ setPassword(e.target.value)
+ }}
className='tw:input tw:input-bordered tw:w-full tw:max-w-xs'
/>
diff --git a/lib/src/Components/Auth/SignupPage.tsx b/lib/src/Components/Auth/SignupPage.tsx
index 1eb51ea9..a24087fd 100644
--- a/lib/src/Components/Auth/SignupPage.tsx
+++ b/lib/src/Components/Auth/SignupPage.tsx
@@ -32,7 +32,7 @@ export function SignupPage() {
},
error: {
render({ data }) {
- return `${data as string}`
+ return data as string
},
autoClose: 10000,
},
@@ -61,20 +61,26 @@ export function SignupPage() {
type='text'
placeholder='Name'
value={userName}
- onChange={(e) => setUserName(e.target.value)}
+ onChange={(e) => {
+ setUserName(e.target.value)
+ }}
className='tw:input tw:input-bordered tw:w-full tw:max-w-xs'
/>
setEmail(e.target.value)}
+ onChange={(e) => {
+ setEmail(e.target.value)
+ }}
className='tw:input tw:input-bordered tw:w-full tw:max-w-xs'
/>
setPassword(e.target.value)}
+ onChange={(e) => {
+ setPassword(e.target.value)
+ }}
className='tw:input tw:input-bordered tw:w-full tw:max-w-xs'
/>
diff --git a/lib/src/Components/Auth/useAuth.tsx b/lib/src/Components/Auth/useAuth.tsx
index 413e88f5..a199e5ca 100644
--- a/lib/src/Components/Auth/useAuth.tsx
+++ b/lib/src/Components/Auth/useAuth.tsx
@@ -135,7 +135,8 @@ export const AuthProvider = ({ userApi, children }: AuthProviderProps) => {
setLoading(true)
try {
await userApi.requestPasswordReset(email, resetUrl)
- return setLoading(false)
+ setLoading(false)
+ return
} catch (error) {
setLoading(false)
throw error
@@ -146,7 +147,8 @@ export const AuthProvider = ({ userApi, children }: AuthProviderProps) => {
setLoading(true)
try {
await userApi.passwordReset(token, newPassword)
- return setLoading(false)
+ setLoading(false)
+ return
} catch (error) {
setLoading(false)
throw error
diff --git a/lib/src/Components/Gaming/Quests.tsx b/lib/src/Components/Gaming/Quests.tsx
index 944a2633..35d512b6 100644
--- a/lib/src/Components/Gaming/Quests.tsx
+++ b/lib/src/Components/Gaming/Quests.tsx
@@ -44,7 +44,9 @@ export function Quests() {
diff --git a/lib/src/Components/Input/Autocomplete.tsx b/lib/src/Components/Input/Autocomplete.tsx
index 2bb97d2c..ae9be9c7 100644
--- a/lib/src/Components/Input/Autocomplete.tsx
+++ b/lib/src/Components/Input/Autocomplete.tsx
@@ -85,7 +85,9 @@ export const Autocomplete = ({
ref={inputRef}
{...inputProps}
type='text'
- onChange={(e) => handleChange(e)}
+ onChange={(e) => {
+ handleChange(e)
+ }}
tabIndex='-1'
onKeyDown={handleKeyDown}
className='tw:border-none tw:focus:outline-none tw:focus:ring-0 tw:mt-5'
@@ -94,7 +96,12 @@ export const Autocomplete = ({
className={`tw:absolute tw:z-4000 ${filteredSuggestions.length > 0 && 'tw:bg-base-100 tw:rounded-xl tw:p-2'}`}
>
{filteredSuggestions.map((suggestion, index) => (
-
handleSuggestionClick(suggestion)}>
+ {
+ handleSuggestionClick(suggestion)
+ }}
+ >
))}
diff --git a/lib/src/Components/Map/Subcomponents/AddButton.tsx b/lib/src/Components/Map/Subcomponents/AddButton.tsx
index ab0e744b..245d3c38 100644
--- a/lib/src/Components/Map/Subcomponents/AddButton.tsx
+++ b/lib/src/Components/Map/Subcomponents/AddButton.tsx
@@ -89,7 +89,9 @@ export default function AddButton({
tabIndex={0}
className='tw:z-500 tw:border-0 tw:p-0 tw:w-10 tw:h-10 tw:cursor-pointer tw:rounded-full tw:mouse tw:drop-shadow-md tw:transition tw:ease-in tw:duration-200 tw:focus:outline-hidden tw:flex tw:items-center tw:justify-center'
style={{ backgroundColor: layer.menuColor || '#777' }}
- onClick={() => handleLayerClick(layer)}
+ onClick={() => {
+ handleLayerClick(layer)
+ }}
onTouchEnd={(e) => {
handleLayerClick(layer)
e.preventDefault()
diff --git a/lib/src/Components/Map/Subcomponents/Controls/FilterControl.tsx b/lib/src/Components/Map/Subcomponents/Controls/FilterControl.tsx
index e5c6c340..b1fcc10f 100644
--- a/lib/src/Components/Map/Subcomponents/Controls/FilterControl.tsx
+++ b/lib/src/Components/Map/Subcomponents/Controls/FilterControl.tsx
@@ -18,7 +18,9 @@ export function FilterControl() {
]
useEffect(() => {
- groupTypes.map((layer) => addVisibleGroupType(layer.value))
+ groupTypes.map((layer) => {
+ addVisibleGroupType(layer.value)
+ })
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])
@@ -48,7 +50,9 @@ export function FilterControl() {
>
toggleVisibleGroupType(groupType.value)}
+ onChange={() => {
+ toggleVisibleGroupType(groupType.value)
+ }}
type='checkbox'
className='tw:checkbox tw:checkbox-xs tw:checkbox-success'
checked={isGroupTypeVisible(groupType.value)}
diff --git a/lib/src/Components/Map/Subcomponents/Controls/LayerControl.tsx b/lib/src/Components/Map/Subcomponents/Controls/LayerControl.tsx
index 83a1a29d..6e40bd07 100644
--- a/lib/src/Components/Map/Subcomponents/Controls/LayerControl.tsx
+++ b/lib/src/Components/Map/Subcomponents/Controls/LayerControl.tsx
@@ -36,7 +36,9 @@ export function LayerControl({ expandLayerControl = false }: { expandLayerContro
>
toggleVisibleLayer(layer)}
+ onChange={() => {
+ toggleVisibleLayer(layer)
+ }}
type='checkbox'
className='tw:checkbox tw:checkbox-xs tw:checkbox-success tw:text-white'
checked={isLayerVisible(layer)}
diff --git a/lib/src/Components/Map/Subcomponents/Controls/LocateControl.tsx b/lib/src/Components/Map/Subcomponents/Controls/LocateControl.tsx
index a77380a5..c20aad8d 100644
--- a/lib/src/Components/Map/Subcomponents/Controls/LocateControl.tsx
+++ b/lib/src/Components/Map/Subcomponents/Controls/LocateControl.tsx
@@ -206,7 +206,9 @@ export const LocateControl = (): JSX.Element => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
if (lc) lc.stop()
// Reset flag after a delay to allow future updates
- setTimeout(() => setHasUpdatedPosition(false), 5000)
+ setTimeout(() => {
+ setHasUpdatedPosition(false)
+ }, 5000)
} catch (error: unknown) {
if (error instanceof Error) {
toast.update(toastId, {
@@ -278,7 +280,9 @@ export const LocateControl = (): JSX.Element => {