diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 42ae92d08..2b9018625 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -3,6 +3,7 @@ module.exports = { parser: '@typescript-eslint/parser', overrides: [ { + files: ['*.ts', '*.tsx'], parserOptions: { ecmaVersion: 6, ecmaFeatures: { @@ -26,6 +27,7 @@ module.exports = { env: { browser: true, es6: true, + node: true, }, plugins: ['react', 'react-hooks', 'prettier', '@typescript-eslint'], extends: [ @@ -36,9 +38,10 @@ module.exports = { 'plugin:@typescript-eslint/recommended', ], rules: { - eqeqeq: 'error', + '@typescript-eslint/no-var-requires': 0, + '@typescript-eslint/ban-ts-comment': 0, 'prettier/prettier': [ - 'error', + 'warn', { endOfLine: 'auto', }, @@ -57,6 +60,5 @@ module.exports = { 'no-use-before-define': 0, '@typescript-eslint/no-use-before-define': 'warn', '@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }], - '@typescript-eslint/ban-ts-comment': ['error', { 'ts-expect-error': 'allow-with-description' }], }, }; diff --git a/package-lock.json b/package-lock.json index b86b2ba61..dcecf5003 100644 --- a/package-lock.json +++ b/package-lock.json @@ -78,10 +78,10 @@ "autoprefixer": "^10.4.7", "babel-plugin-styled-components": "^2.1.4", "cross-env": "^7.0.2", - "eslint": "^8.18.0", + "eslint": "^8.57.0", "eslint-config-prettier": "^8.5.0", "eslint-plugin-node": "^11.1.0", - "eslint-plugin-prettier": "^4.0.0", + "eslint-plugin-prettier": "^5.1.3", "eslint-plugin-react": "^7.30.1", "eslint-plugin-react-hooks": "^4.6.0", "postcss": "^8.4.38", @@ -2262,6 +2262,18 @@ "node": ">=14" } }, + "node_modules/@pkgr/core": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.1.tgz", + "integrity": "sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, "node_modules/@preact/signals-core": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/@preact/signals-core/-/signals-core-1.6.0.tgz", @@ -5410,21 +5422,30 @@ } }, "node_modules/eslint-plugin-prettier": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz", - "integrity": "sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==", + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.1.3.tgz", + "integrity": "sha512-C9GCVAs4Eq7ZC/XFQHITLiHJxQngdtraXaM+LoUFoFp/lHNl2Zn8f3WQbe9HvTBBQ9YnKFB0/2Ajdqwo5D1EAw==", "dev": true, "dependencies": { - "prettier-linter-helpers": "^1.0.0" + "prettier-linter-helpers": "^1.0.0", + "synckit": "^0.8.6" }, "engines": { - "node": ">=12.0.0" + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint-plugin-prettier" }, "peerDependencies": { - "eslint": ">=7.28.0", - "prettier": ">=2.0.0" + "@types/eslint": ">=8.0.0", + "eslint": ">=8.0.0", + "eslint-config-prettier": "*", + "prettier": ">=3.0.0" }, "peerDependenciesMeta": { + "@types/eslint": { + "optional": true + }, "eslint-config-prettier": { "optional": true } @@ -9114,6 +9135,22 @@ "react": "^16.11.0 || ^17.0.0 || ^18.0.0" } }, + "node_modules/synckit": { + "version": "0.8.8", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.8.8.tgz", + "integrity": "sha512-HwOKAP7Wc5aRGYdKH+dw0PRRpbO841v2DENBtjnR5HFWoiNByAl7vrx3p0G/rCyYXQsrxqtX48TImFtPcIHSpQ==", + "dev": true, + "dependencies": { + "@pkgr/core": "^0.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, "node_modules/tailwind-merge": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-2.2.2.tgz", diff --git a/package.json b/package.json index 1f0ca32e3..3b501802e 100644 --- a/package.json +++ b/package.json @@ -77,10 +77,10 @@ "autoprefixer": "^10.4.7", "babel-plugin-styled-components": "^2.1.4", "cross-env": "^7.0.2", - "eslint": "^8.18.0", + "eslint": "^8.57.0", "eslint-config-prettier": "^8.5.0", "eslint-plugin-node": "^11.1.0", - "eslint-plugin-prettier": "^4.0.0", + "eslint-plugin-prettier": "^5.1.3", "eslint-plugin-react": "^7.30.1", "eslint-plugin-react-hooks": "^4.6.0", "postcss": "^8.4.38", diff --git a/resources/scripts/api/account/activity.ts b/resources/scripts/api/account/activity.ts index 037b4bd06..cbbec66f3 100644 --- a/resources/scripts/api/account/activity.ts +++ b/resources/scripts/api/account/activity.ts @@ -12,7 +12,7 @@ export type ActivityLogFilters = QueryBuilderParams<'ip' | 'event', 'timestamp'> const useActivityLogs = ( filters?: ActivityLogFilters, - config?: SWRConfiguration, AxiosError> + config?: SWRConfiguration, AxiosError>, ) => { const key = useUserSWRKey(['account', 'activity', JSON.stringify(useFilteredObject(filters || {}))]); @@ -28,7 +28,7 @@ const useActivityLogs = ( return toPaginatedSet(data, Transformers.toActivityLog); }, - { revalidateOnMount: false, ...(config || {}) } + { revalidateOnMount: false, ...(config || {}) }, ); }; diff --git a/resources/scripts/api/account/createApiKey.ts b/resources/scripts/api/account/createApiKey.ts index b20760e62..f2cf27b3a 100644 --- a/resources/scripts/api/account/createApiKey.ts +++ b/resources/scripts/api/account/createApiKey.ts @@ -12,7 +12,7 @@ export default (description: string, allowedIps: string): Promise) => { return Transformers.toSSHKey(datum.attributes); }); }, - { revalidateOnMount: false, ...(config || {}) } + { revalidateOnMount: false, ...(config || {}) }, ); }; diff --git a/resources/scripts/api/auth/login.ts b/resources/scripts/api/auth/login.ts index ff0de7ac6..57552e5ed 100644 --- a/resources/scripts/api/auth/login.ts +++ b/resources/scripts/api/auth/login.ts @@ -20,7 +20,7 @@ export default ({ username, password, recaptchaData }: LoginData): Promise { if (!(response.data instanceof Object)) { diff --git a/resources/scripts/api/auth/loginCheckpoint.ts b/resources/scripts/api/auth/loginCheckpoint.ts index 73ffb2111..da92d36bc 100644 --- a/resources/scripts/api/auth/loginCheckpoint.ts +++ b/resources/scripts/api/auth/loginCheckpoint.ts @@ -12,7 +12,7 @@ export default (token: string, code: string, recoveryToken?: string): Promise => { resolve({ redirectTo: response.data.redirect_to, sendToLogin: response.data.send_to_login, - }) + }), ) .catch(reject); }); diff --git a/resources/scripts/api/definitions/helpers.ts b/resources/scripts/api/definitions/helpers.ts index eeb933f5a..895360830 100644 --- a/resources/scripts/api/definitions/helpers.ts +++ b/resources/scripts/api/definitions/helpers.ts @@ -15,17 +15,17 @@ function transform(data: null | undefined, transformer: TransformerFunc function transform( data: FractalResponseData | null | undefined, transformer: TransformerFunc, - missing?: M + missing?: M, ): T | M; function transform( data: FractalResponseList | FractalPaginatedResponse | null | undefined, transformer: TransformerFunc, - missing?: M + missing?: M, ): T[] | M; function transform( data: FractalResponseData | FractalResponseList | FractalPaginatedResponse | null | undefined, transformer: TransformerFunc, - missing = undefined + missing = undefined, ) { if (data === undefined || data === null) { return missing; @@ -44,7 +44,7 @@ function transform( function toPaginatedSet>( response: FractalPaginatedResponse, - transformer: T + transformer: T, ): PaginatedResult> { return { items: transform(response, transformer) as ReturnType[], diff --git a/resources/scripts/api/getServers.ts b/resources/scripts/api/getServers.ts index 4e29f1532..77a057f0d 100644 --- a/resources/scripts/api/getServers.ts +++ b/resources/scripts/api/getServers.ts @@ -19,7 +19,7 @@ export default ({ query, ...params }: QueryParams): Promise rawDataToServerObject(datum)), pagination: getPaginationSet(data.meta.pagination), - }) + }), ) .catch(reject); }); diff --git a/resources/scripts/api/http.ts b/resources/scripts/api/http.ts index 382c1119a..7c21b3965 100644 --- a/resources/scripts/api/http.ts +++ b/resources/scripts/api/http.ts @@ -31,7 +31,7 @@ http.interceptors.response.use( store.getActions().progress.setComplete(); throw error; - } + }, ); export default http; @@ -137,11 +137,14 @@ export interface QueryBuilderParams => { if (!data) return {}; - const filters = Object.keys(data.filters || {}).reduce((obj, key) => { - const value = data.filters?.[key]; + const filters = Object.keys(data.filters || {}).reduce( + (obj, key) => { + const value = data.filters?.[key]; - return !value || value === '' ? obj : { ...obj, [`filter[${key}]`]: value }; - }, {} as NonNullable); + return !value || value === '' ? obj : { ...obj, [`filter[${key}]`]: value }; + }, + {} as NonNullable, + ); const sorts = Object.keys(data.sorts || {}).reduce((arr, key) => { const value = data.sorts?.[key]; diff --git a/resources/scripts/api/interceptors.ts b/resources/scripts/api/interceptors.ts index af43d99f1..fb8409344 100644 --- a/resources/scripts/api/interceptors.ts +++ b/resources/scripts/api/interceptors.ts @@ -5,7 +5,7 @@ import http from '@/api/http'; export const setupInterceptors = (navigate: NavigateFunction) => { http.interceptors.response.use( - resp => resp, + (resp) => resp, (error: AxiosError) => { if (error.response?.status === 400) { if ( @@ -19,4 +19,4 @@ export const setupInterceptors = (navigate: NavigateFunction) => { throw error; }, ); -}; \ No newline at end of file +}; diff --git a/resources/scripts/api/server/activity.ts b/resources/scripts/api/server/activity.ts index c65ea1a44..3e60e7cfd 100644 --- a/resources/scripts/api/server/activity.ts +++ b/resources/scripts/api/server/activity.ts @@ -15,7 +15,7 @@ export type ActivityLogFilters = QueryBuilderParams<'ip' | 'event', 'timestamp'> const useActivityLogs = ( filters?: ActivityLogFilters, - config?: SWRConfiguration, AxiosError> + config?: SWRConfiguration, AxiosError>, ) => { const uuid = ServerContext.useStoreState((state) => state.server.data?.uuid); const key = useServerSWRKey(['activity', useFilteredObject(filters || {})]); @@ -32,7 +32,7 @@ const useActivityLogs = ( return toPaginatedSet(data, Transformers.toActivityLog); }, - { revalidateOnMount: false, ...(config || {}) } + { revalidateOnMount: false, ...(config || {}) }, ); }; diff --git a/resources/scripts/api/server/databases/createServerDatabase.ts b/resources/scripts/api/server/databases/createServerDatabase.ts index cb0c25b9e..d7c113690 100644 --- a/resources/scripts/api/server/databases/createServerDatabase.ts +++ b/resources/scripts/api/server/databases/createServerDatabase.ts @@ -11,7 +11,7 @@ export default (uuid: string, data: { connectionsFrom: string; databaseName: str }, { params: { include: 'password' }, - } + }, ) .then((response) => resolve(rawDataToServerDatabase(response.data.attributes))) .catch(reject); diff --git a/resources/scripts/api/server/databases/getServerDatabases.ts b/resources/scripts/api/server/databases/getServerDatabases.ts index a03eb30a9..b66ebcab4 100644 --- a/resources/scripts/api/server/databases/getServerDatabases.ts +++ b/resources/scripts/api/server/databases/getServerDatabases.ts @@ -24,7 +24,7 @@ export default (uuid: string, includePassword = true): Promise params: includePassword ? { include: 'password' } : undefined, }) .then((response) => - resolve((response.data.data || []).map((item: any) => rawDataToServerDatabase(item.attributes))) + resolve((response.data.data || []).map((item: any) => rawDataToServerDatabase(item.attributes))), ) .catch(reject); }); diff --git a/resources/scripts/api/server/files/compressFiles.ts b/resources/scripts/api/server/files/compressFiles.ts index b4c0a251e..0f7882652 100644 --- a/resources/scripts/api/server/files/compressFiles.ts +++ b/resources/scripts/api/server/files/compressFiles.ts @@ -10,7 +10,7 @@ export default async (uuid: string, directory: string, files: string[]): Promise timeout: 60000, timeoutErrorMessage: 'It looks like this archive is taking a long time to generate. It will appear once completed.', - } + }, ); return rawDataToFileObject(data); diff --git a/resources/scripts/api/server/files/decompressFiles.ts b/resources/scripts/api/server/files/decompressFiles.ts index 37557a671..d3a3e45c2 100644 --- a/resources/scripts/api/server/files/decompressFiles.ts +++ b/resources/scripts/api/server/files/decompressFiles.ts @@ -8,6 +8,6 @@ export default async (uuid: string, directory: string, file: string): Promise => { rawDataToServerObject(data), // eslint-disable-next-line camelcase data.meta?.is_server_owner ? ['*'] : data.meta?.user_permissions || [], - ]) + ]), ) .catch(reject); }); diff --git a/resources/scripts/api/server/getServerResourceUsage.ts b/resources/scripts/api/server/getServerResourceUsage.ts index 200ceb017..dd1ad4307 100644 --- a/resources/scripts/api/server/getServerResourceUsage.ts +++ b/resources/scripts/api/server/getServerResourceUsage.ts @@ -26,7 +26,7 @@ export default (server: string): Promise => { networkRxInBytes: attributes.resources.network_rx_bytes, networkTxInBytes: attributes.resources.network_tx_bytes, uptime: attributes.resources.uptime, - }) + }), ) .catch(reject); }); diff --git a/resources/scripts/api/server/getWebsocketToken.ts b/resources/scripts/api/server/getWebsocketToken.ts index 4769e188b..5b2994b22 100644 --- a/resources/scripts/api/server/getWebsocketToken.ts +++ b/resources/scripts/api/server/getWebsocketToken.ts @@ -12,7 +12,7 @@ export default (server: string): Promise => { resolve({ token: data.data.token, socket: data.data.socket, - }) + }), ) .catch(reject); }); diff --git a/resources/scripts/api/server/schedules/createOrUpdateScheduleTask.ts b/resources/scripts/api/server/schedules/createOrUpdateScheduleTask.ts index 388d8d6d5..e0df70436 100644 --- a/resources/scripts/api/server/schedules/createOrUpdateScheduleTask.ts +++ b/resources/scripts/api/server/schedules/createOrUpdateScheduleTask.ts @@ -16,7 +16,7 @@ export default async (uuid: string, schedule: number, task: number | undefined, payload: data.payload, continue_on_failure: data.continueOnFailure, time_offset: data.timeOffset, - } + }, ); return rawDataToServerTask(response.attributes); diff --git a/resources/scripts/api/swr/getServerAllocations.ts b/resources/scripts/api/swr/getServerAllocations.ts index 0e603110d..a7c92b0fa 100644 --- a/resources/scripts/api/swr/getServerAllocations.ts +++ b/resources/scripts/api/swr/getServerAllocations.ts @@ -15,6 +15,6 @@ export default () => { return (data.data || []).map(rawDataToServerAllocation); }, - { revalidateOnFocus: false, revalidateOnMount: false } + { revalidateOnFocus: false, revalidateOnMount: false }, ); -}; \ No newline at end of file +}; diff --git a/resources/scripts/api/swr/getServerBackups.ts b/resources/scripts/api/swr/getServerBackups.ts index 008b3eba5..4737948b6 100644 --- a/resources/scripts/api/swr/getServerBackups.ts +++ b/resources/scripts/api/swr/getServerBackups.ts @@ -29,4 +29,4 @@ export default () => { backupCount: data.meta.backup_count, }; }); -}; \ No newline at end of file +}; diff --git a/resources/scripts/api/swr/getServerStartup.ts b/resources/scripts/api/swr/getServerStartup.ts index 17fc1d2a5..df05bdb3f 100644 --- a/resources/scripts/api/swr/getServerStartup.ts +++ b/resources/scripts/api/swr/getServerStartup.ts @@ -26,5 +26,5 @@ export default (uuid: string, fallbackData?: Response, config?: SWRConfiguration dockerImages: data.meta.docker_images || {}, }; }, - { fallbackData, errorRetryCount: 3, ...(config ?? {}) } + { fallbackData, errorRetryCount: 3, ...(config ?? {}) }, ); diff --git a/resources/scripts/components/FlashMessageRender.tsx b/resources/scripts/components/FlashMessageRender.tsx index 5db827fb1..6a1009148 100644 --- a/resources/scripts/components/FlashMessageRender.tsx +++ b/resources/scripts/components/FlashMessageRender.tsx @@ -4,12 +4,11 @@ import { Fragment } from 'react'; type Props = Readonly<{ byKey?: string; - className?: string; }>; -const FlashMessageRender = ({ byKey, className }: Props) => { +const FlashMessageRender = ({ byKey }: Props) => { const flashes = useStoreState((state) => - state.flashes.items.filter((flash) => (byKey ? flash.key === byKey : true)) + state.flashes.items.filter((flash) => (byKey ? flash.key === byKey : true)), ); return flashes.length ? ( diff --git a/resources/scripts/components/auth/ForgotPasswordContainer.tsx b/resources/scripts/components/auth/ForgotPasswordContainer.tsx index 0200b31db..08ddb9ebe 100644 --- a/resources/scripts/components/auth/ForgotPasswordContainer.tsx +++ b/resources/scripts/components/auth/ForgotPasswordContainer.tsx @@ -89,7 +89,7 @@ export default () => { />

Reset Password

-
We'll send you an email with a link to reset your password.
+
We'll send you an email with a link to reset your password.
) : ( diff --git a/resources/scripts/components/dashboard/forms/CreateApiKeyForm.tsx b/resources/scripts/components/dashboard/forms/CreateApiKeyForm.tsx index dd17261c3..0fa1d6a79 100644 --- a/resources/scripts/components/dashboard/forms/CreateApiKeyForm.tsx +++ b/resources/scripts/components/dashboard/forms/CreateApiKeyForm.tsx @@ -9,7 +9,7 @@ import { httpErrorToHuman } from '@/api/http'; import SpinnerOverlay from '@/components/elements/SpinnerOverlay'; import { ApiKey } from '@/api/account/getApiKeys'; import Button from '@/components/elements/Button'; -import Input, { Textarea } from '@/components/elements/Input'; +import Input from '@/components/elements/Input'; import ApiKeyModal from '@/components/dashboard/ApiKeyModal'; interface Values { diff --git a/resources/scripts/components/dashboard/forms/DisableTOTPDialog.tsx b/resources/scripts/components/dashboard/forms/DisableTOTPDialog.tsx index 3e68cdc57..521857b43 100644 --- a/resources/scripts/components/dashboard/forms/DisableTOTPDialog.tsx +++ b/resources/scripts/components/dashboard/forms/DisableTOTPDialog.tsx @@ -40,7 +40,7 @@ const DisableTOTPDialog = () => { return (
- + diff --git a/resources/scripts/components/dashboard/forms/SetupTOTPDialog.tsx b/resources/scripts/components/dashboard/forms/SetupTOTPDialog.tsx index 5d17336dd..3b9a025cb 100644 --- a/resources/scripts/components/dashboard/forms/SetupTOTPDialog.tsx +++ b/resources/scripts/components/dashboard/forms/SetupTOTPDialog.tsx @@ -60,7 +60,7 @@ const ConfigureTwoFactorForm = ({ onTokens }: Props) => { return ( - +
{!token ? ( diff --git a/resources/scripts/components/dashboard/forms/UpdateEmailAddressForm.tsx b/resources/scripts/components/dashboard/forms/UpdateEmailAddressForm.tsx index 37ae46f86..80abb22a9 100644 --- a/resources/scripts/components/dashboard/forms/UpdateEmailAddressForm.tsx +++ b/resources/scripts/components/dashboard/forms/UpdateEmailAddressForm.tsx @@ -33,7 +33,7 @@ export default () => { type: 'success', key: 'account:email', message: 'Your primary email has been updated.', - }) + }), ) .catch((error) => addFlash({ @@ -41,7 +41,7 @@ export default () => { key: 'account:email', title: 'Error', message: httpErrorToHuman(error), - }) + }), ) .then(() => { resetForm(); diff --git a/resources/scripts/components/dashboard/forms/UpdatePasswordForm.tsx b/resources/scripts/components/dashboard/forms/UpdatePasswordForm.tsx index a59a6caff..56f51d3b6 100644 --- a/resources/scripts/components/dashboard/forms/UpdatePasswordForm.tsx +++ b/resources/scripts/components/dashboard/forms/UpdatePasswordForm.tsx @@ -7,7 +7,7 @@ import updateAccountPassword from '@/api/account/updateAccountPassword'; import { httpErrorToHuman } from '@/api/http'; import { ApplicationStore } from '@/state'; import { Button } from '@/components/elements/button/index'; -import { Fragment } from 'react' +import { Fragment } from 'react'; interface Values { current: string; @@ -23,7 +23,7 @@ const schema = Yup.object().shape({ 'Password confirmation does not match the password you entered.', function (value) { return value === this.parent.password; - } + }, ), }); @@ -48,7 +48,7 @@ export default () => { type: 'error', title: 'Error', message: httpErrorToHuman(error), - }) + }), ) .then(() => setSubmitting(false)); }; diff --git a/resources/scripts/components/dashboard/ssh/AccountSSHContainer.tsx b/resources/scripts/components/dashboard/ssh/AccountSSHContainer.tsx index 24df1542e..ab6cce6f8 100644 --- a/resources/scripts/components/dashboard/ssh/AccountSSHContainer.tsx +++ b/resources/scripts/components/dashboard/ssh/AccountSSHContainer.tsx @@ -35,10 +35,8 @@ export default () => { {!data ? 'Loading...' : 'No SSH Keys exist for this account.'}

) : ( - data.map((key, index) => ( - + data.map((key, _) => ( + {/* */}

{key.name}

diff --git a/resources/scripts/components/dashboard/ssh/CreateSSHKeyForm.tsx b/resources/scripts/components/dashboard/ssh/CreateSSHKeyForm.tsx index 7b4f92c5f..88c9617ca 100644 --- a/resources/scripts/components/dashboard/ssh/CreateSSHKeyForm.tsx +++ b/resources/scripts/components/dashboard/ssh/CreateSSHKeyForm.tsx @@ -3,8 +3,7 @@ import { object, string } from 'yup'; import FormikFieldWrapper from '@/components/elements/FormikFieldWrapper'; import SpinnerOverlay from '@/components/elements/SpinnerOverlay'; import Button from '@/components/elements/Button'; -import Input, { Textarea } from '@/components/elements/Input'; -import styled from 'styled-components'; +import Input from '@/components/elements/Input'; import { useFlashKey } from '@/plugins/useFlash'; import { createSSHKey, useSSHKeys } from '@/api/account/ssh-keys'; diff --git a/resources/scripts/components/elements/ContentBox.tsx b/resources/scripts/components/elements/ContentBox.tsx index d3f512cb5..dde5afe08 100644 --- a/resources/scripts/components/elements/ContentBox.tsx +++ b/resources/scripts/components/elements/ContentBox.tsx @@ -10,7 +10,7 @@ type Props = Readonly< } >; -const ContentBox = ({ title, borderColor, showFlashes, showLoadingOverlay, children, ...props }: Props) => ( +const ContentBox = ({ title, showFlashes, showLoadingOverlay, children, ...props }: Props) => (
{title &&

{title}

} {showFlashes && } diff --git a/resources/scripts/components/elements/ContextMenu.tsx b/resources/scripts/components/elements/ContextMenu.tsx index a2e18ee77..314a4448e 100644 --- a/resources/scripts/components/elements/ContextMenu.tsx +++ b/resources/scripts/components/elements/ContextMenu.tsx @@ -27,7 +27,7 @@ const ContextMenuSubTrigger = React.forwardRef< className={cn( 'flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground', inset && 'pl-8', - className + className, )} {...props} > @@ -45,7 +45,7 @@ const ContextMenuSubContent = React.forwardRef< ref={ref} className={cn( 'z-50 min-w-[14rem] overflow-hidden rounded-xl bg-[#ffffff22] backdrop-blur-2xl p-2 shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2', - className + className, )} {...props} /> @@ -61,7 +61,7 @@ const ContextMenuContent = React.forwardRef< ref={ref} className={cn( 'z-50 min-w-[14rem] overflow-hidden rounded-xl bg-[#ffffff22] backdrop-blur-2xl p-2 shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2', - className + className, )} {...props} /> @@ -80,7 +80,7 @@ const ContextMenuItem = React.forwardRef< className={cn( 'font-bold relative flex cursor-default select-none items-center rounded-lg px-2 py-1.5 text-sm outline-none focus:bg-[#ffffff33] data-[disabled]:pointer-events-none data-[disabled]:opacity-50', inset && 'pl-8', - className + className, )} {...props} /> @@ -95,7 +95,7 @@ const ContextMenuCheckboxItem = React.forwardRef< ref={ref} className={cn( 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', - className + className, )} checked={checked} {...props} @@ -118,7 +118,7 @@ const ContextMenuRadioItem = React.forwardRef< ref={ref} className={cn( 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', - className + className, )} {...props} > diff --git a/resources/scripts/components/elements/DropdownMenu.tsx b/resources/scripts/components/elements/DropdownMenu.tsx index 7e0e48aa4..d6a4d13a1 100644 --- a/resources/scripts/components/elements/DropdownMenu.tsx +++ b/resources/scripts/components/elements/DropdownMenu.tsx @@ -27,7 +27,7 @@ const DropdownMenuSubTrigger = React.forwardRef< className={cn( 'flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent', inset && 'pl-8', - className + className, )} {...props} > @@ -45,7 +45,7 @@ const DropdownMenuSubContent = React.forwardRef< ref={ref} className={cn( 'z-50 min-w-[14rem] overflow-hidden rounded-xl bg-[#ffffff22] backdrop-blur-2xl p-2 shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2', - className + className, )} {...props} /> @@ -63,7 +63,7 @@ const DropdownMenuContent = React.forwardRef< className={cn( 'z-50 min-w-[14rem] overflow-hidden rounded-xl bg-[#ffffff22] backdrop-blur-2xl p-2 shadow-md', 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2', - className + className, )} {...props} /> @@ -82,7 +82,7 @@ const DropdownMenuItem = React.forwardRef< className={cn( 'font-bold relative flex cursor-default select-none items-center rounded-lg px-2 py-1.5 text-sm outline-none transition-colors focus:bg-[#ffffff33] data-[disabled]:pointer-events-none data-[disabled]:opacity-50', inset && 'pl-8', - className + className, )} {...props} /> @@ -97,7 +97,7 @@ const DropdownMenuCheckboxItem = React.forwardRef< ref={ref} className={cn( 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', - className + className, )} checked={checked} {...props} @@ -120,7 +120,7 @@ const DropdownMenuRadioItem = React.forwardRef< ref={ref} className={cn( 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', - className + className, )} {...props} > diff --git a/resources/scripts/components/elements/Field.tsx b/resources/scripts/components/elements/Field.tsx index de67976bd..15a70c95a 100644 --- a/resources/scripts/components/elements/Field.tsx +++ b/resources/scripts/components/elements/Field.tsx @@ -3,7 +3,6 @@ import { Field as FormikField, FieldProps } from 'formik'; interface OwnProps { name: string; - light?: boolean; label?: string; description?: string; validate?: (value: any) => undefined | string | Promise; @@ -12,7 +11,7 @@ interface OwnProps { type Props = OwnProps & Omit, 'name'>; const Field = forwardRef( - ({ id, name, light = false, label, description, validate, ...props }, ref) => ( + ({ id, name = false, label, description, validate, ...props }, ref) => ( {({ field, form: { errors, touched } }: FieldProps) => (
@@ -38,7 +37,7 @@ const Field = forwardRef(
)}
- ) + ), ); Field.displayName = 'Field'; diff --git a/resources/scripts/components/elements/Icon.tsx b/resources/scripts/components/elements/Icon.tsx index 89086816f..a4ecc8ff3 100644 --- a/resources/scripts/components/elements/Icon.tsx +++ b/resources/scripts/components/elements/Icon.tsx @@ -1,7 +1,5 @@ const Icon = () => { - return ( -
This component is deprecated.
- ); + return
This component is deprecated.
; }; export default Icon; diff --git a/resources/scripts/components/elements/Input.tsx b/resources/scripts/components/elements/Input.tsx index 2d4d30304..3d01eb90e 100644 --- a/resources/scripts/components/elements/Input.tsx +++ b/resources/scripts/components/elements/Input.tsx @@ -8,17 +8,17 @@ export interface Props { const checkboxStyle = css` color-adjust: exact; background-origin: border-box; - transition: all 75ms linear, box-shadow 25ms linear; + transition: + all 75ms linear, + box-shadow 25ms linear; &:checked { - background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='black' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M5.707 7.293a1 1 0 0 0-1.414 1.414l2 2a1 1 0 0 0 1.414 0l4-4a1 1 0 0 0-1.414-1.414L7 8.586 5.707 7.293z'/%3e%3c/svg%3e"); background-color: white; background-size: 100% 100%; } &:focus { - box-shadow: 0 0 0 1px rgba(9, 103, 210, 0.25); } `; @@ -28,12 +28,10 @@ const inputStyle = css` resize: none; & + .input-help { - } &:required, &:invalid { - } &:not(:disabled):not(:read-only):focus { @@ -53,7 +51,6 @@ const Input = styled.input` ${checkboxStyle}; &[type='radio'] { - } } `; diff --git a/resources/scripts/components/elements/Modal.tsx b/resources/scripts/components/elements/Modal.tsx index fbfbc5160..fac850152 100644 --- a/resources/scripts/components/elements/Modal.tsx +++ b/resources/scripts/components/elements/Modal.tsx @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unused-vars */ import { Fragment, useEffect, useMemo, useRef, useState } from 'react'; import Spinner from '@/components/elements/Spinner'; import styled from 'styled-components'; diff --git a/resources/scripts/components/elements/Pagination.tsx b/resources/scripts/components/elements/Pagination.tsx index fd85207a5..2bdb54772 100644 --- a/resources/scripts/components/elements/Pagination.tsx +++ b/resources/scripts/components/elements/Pagination.tsx @@ -16,7 +16,7 @@ interface Props { children: (props: RenderFuncProps) => React.ReactNode; } -const Block = styled(Button)`` +const Block = styled(Button)``; function Pagination({ data: { items, pagination }, onPageSelect, children }: Props) { const isFirstPage = pagination.currentPage === 1; diff --git a/resources/scripts/components/elements/ScreenBlock.tsx b/resources/scripts/components/elements/ScreenBlock.tsx index 8a0c2921c..3bf377892 100644 --- a/resources/scripts/components/elements/ScreenBlock.tsx +++ b/resources/scripts/components/elements/ScreenBlock.tsx @@ -33,8 +33,8 @@ const NotFound = () => {

Page Not Found

- We couldn't find the page you're looking for. You may have lost access, or the page may have - been removed. Here are some helpful links instead: + We couldn't find the page you're looking for. You may have lost access, or the page + may have been removed. Here are some helpful links instead:

diff --git a/resources/scripts/components/elements/Spinner.tsx b/resources/scripts/components/elements/Spinner.tsx index 70822cc33..3b8f8dd1b 100644 --- a/resources/scripts/components/elements/Spinner.tsx +++ b/resources/scripts/components/elements/Spinner.tsx @@ -31,12 +31,12 @@ const SpinnerComponent = styled.div` props.size === 'small' ? `width: 16px; height: 16px; border-width: 2px;` : props.size === 'large' - ? css` - width: 64px; - height: 64px; - border-width: 6px; - ` - : null}; + ? css` + width: 64px; + height: 64px; + border-width: 6px; + ` + : null}; border-color: ${(props) => (!props.isBlue ? 'rgba(255, 255, 255, 0.2)' : 'hsla(212, 92%, 43%, 0.2)')}; border-top-color: ${(props) => (!props.isBlue ? 'rgb(255, 255, 255)' : 'hsl(212, 92%, 43%)')}; @@ -58,6 +58,7 @@ Spinner.Size = { LARGE: 'large', }; +// eslint-disable-next-line @typescript-eslint/no-unused-vars Spinner.Suspense = ({ children, centered = true, size = Spinner.Size.LARGE, ...props }) => ( // diff --git a/resources/scripts/components/elements/Switch.tsx b/resources/scripts/components/elements/Switch.tsx index 39586fb71..2acf9763c 100644 --- a/resources/scripts/components/elements/Switch.tsx +++ b/resources/scripts/components/elements/Switch.tsx @@ -4,7 +4,7 @@ import { v4 } from 'uuid'; import Label from '@/components/elements/Label'; import Input from '@/components/elements/Input'; -const ToggleContainer = styled.div`` +const ToggleContainer = styled.div``; // const ToggleContainer = styled.div` // ${tw`relative select-none w-12 leading-normal`}; @@ -67,11 +67,7 @@ const Switch = ({ name, label, description, defaultChecked, readOnly, onChange, {(label || description) && (
- {label && ( - - )} + {label && } {description &&

{description}

}
)} diff --git a/resources/scripts/components/elements/alert/Alert.tsx b/resources/scripts/components/elements/alert/Alert.tsx index fb25042ee..e19e9ce32 100644 --- a/resources/scripts/components/elements/alert/Alert.tsx +++ b/resources/scripts/components/elements/alert/Alert.tsx @@ -17,7 +17,7 @@ export default ({ type, className, children }: AlertProps) => { ['border-red-500 bg-red-500/25']: type === 'danger', ['border-yellow-500 bg-yellow-500/25']: type === 'warning', }, - className + className, )} > {type === 'danger' ? ( diff --git a/resources/scripts/components/elements/button/Button.tsx b/resources/scripts/components/elements/button/Button.tsx index b1bd6ca79..28e3ca427 100644 --- a/resources/scripts/components/elements/button/Button.tsx +++ b/resources/scripts/components/elements/button/Button.tsx @@ -17,14 +17,14 @@ const Button = forwardRef( [styles.small]: size === Options.Size.Small, [styles.large]: size === Options.Size.Large, }, - className + className, )} {...rest} > {children} ); - } + }, ); const TextButton = forwardRef(({ className, ...props }, ref) => ( diff --git a/resources/scripts/components/elements/dialog/DialogIcon.tsx b/resources/scripts/components/elements/dialog/DialogIcon.tsx index f72e86eca..2e90942b0 100644 --- a/resources/scripts/components/elements/dialog/DialogIcon.tsx +++ b/resources/scripts/components/elements/dialog/DialogIcon.tsx @@ -20,7 +20,7 @@ export default ({ type, position, className }: DialogIconProps) => {
{/* */}
FIXME: Icons
-
+
, ); }, [type, className]); diff --git a/resources/scripts/components/elements/inputs/index.ts b/resources/scripts/components/elements/inputs/index.ts index b961b0764..3b7f15d77 100644 --- a/resources/scripts/components/elements/inputs/index.ts +++ b/resources/scripts/components/elements/inputs/index.ts @@ -6,7 +6,7 @@ const Input = Object.assign( { Text: InputField, Checkbox: Checkbox, - } + }, ); export { Input }; diff --git a/resources/scripts/components/elements/transitions/FadeTransition.tsx b/resources/scripts/components/elements/transitions/FadeTransition.tsx index be0dd6425..dc59f0883 100644 --- a/resources/scripts/components/elements/transitions/FadeTransition.tsx +++ b/resources/scripts/components/elements/transitions/FadeTransition.tsx @@ -16,8 +16,8 @@ function FadeTransition({ children, duration, ...props }: Props) { const [enterDuration, exitDuration] = Array.isArray(duration) ? duration : !duration - ? ['duration-200', 'duration-100'] - : [duration, duration]; + ? ['duration-200', 'duration-100'] + : [duration, duration]; return ( { const status = ServerContext.useStoreState((state) => state.server.data?.status || null); const isTransferring = ServerContext.useStoreState((state) => state.server.data?.isTransferring || false); const isNodeUnderMaintenance = ServerContext.useStoreState( - (state) => state.server.data?.isNodeUnderMaintenance || false + (state) => state.server.data?.isNodeUnderMaintenance || false, ); return status === 'installing' || status === 'install_failed' || status === 'reinstall_failed' ? ( diff --git a/resources/scripts/components/server/WebsocketHandler.tsx b/resources/scripts/components/server/WebsocketHandler.tsx index defa42dd4..7d1ee344f 100644 --- a/resources/scripts/components/server/WebsocketHandler.tsx +++ b/resources/scripts/components/server/WebsocketHandler.tsx @@ -55,7 +55,7 @@ function WebsocketHandler() { updateToken(uuid, socket); } else { setError( - 'There was an error validating the credentials provided for the websocket. Please refresh the page.' + 'There was an error validating the credentials provided for the websocket. Please refresh the page.', ); } }); diff --git a/resources/scripts/components/server/backups/BackupRow.tsx b/resources/scripts/components/server/backups/BackupRow.tsx index 3ef365b9f..57b4f20de 100644 --- a/resources/scripts/components/server/backups/BackupRow.tsx +++ b/resources/scripts/components/server/backups/BackupRow.tsx @@ -13,10 +13,9 @@ import Can from '@/components/elements/Can'; interface Props { backup: ServerBackup; - className?: string; } -export default ({ backup, className }: Props) => { +export default ({ backup }: Props) => { const { mutate } = getServerBackups(); useWebsocketEvent(`${SocketEvent.BACKUP_COMPLETED}:${backup.uuid}` as SocketEvent, async (data) => { diff --git a/resources/scripts/components/server/backups/CreateBackupButton.tsx b/resources/scripts/components/server/backups/CreateBackupButton.tsx index 262a25cad..08b7d121d 100644 --- a/resources/scripts/components/server/backups/CreateBackupButton.tsx +++ b/resources/scripts/components/server/backups/CreateBackupButton.tsx @@ -82,7 +82,7 @@ export default () => { .then(async (backup) => { await mutate( (data) => ({ ...data!, items: data!.items.concat(backup), backupCount: data!.backupCount + 1 }), - false + false, ); setVisible(false); }) diff --git a/resources/scripts/components/server/console/ServerDetailsBlock.tsx b/resources/scripts/components/server/console/ServerDetailsBlock.tsx index e3c23619f..9aa88f18f 100644 --- a/resources/scripts/components/server/console/ServerDetailsBlock.tsx +++ b/resources/scripts/components/server/console/ServerDetailsBlock.tsx @@ -21,7 +21,9 @@ type Stats = Record<'memory' | 'cpu' | 'disk' | 'uptime' | 'rx' | 'tx', number>; // return undefined; // }; +// eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore +// eslint-disable-next-line @typescript-eslint/no-unused-vars const Limit = ({ limit, children }: { limit: string | null; children: React.ReactNode }) => <>{children}; const ServerDetailsBlock = ({ className }: { className?: string }) => { diff --git a/resources/scripts/components/server/databases/CreateDatabaseButton.tsx b/resources/scripts/components/server/databases/CreateDatabaseButton.tsx index d2b28c76a..e194ad96e 100644 --- a/resources/scripts/components/server/databases/CreateDatabaseButton.tsx +++ b/resources/scripts/components/server/databases/CreateDatabaseButton.tsx @@ -22,7 +22,7 @@ const schema = object().shape({ .max(48, 'Database name must not exceed 48 characters.') .matches( /^[\w\-.]{3,48}$/, - 'Database name should only contain alphanumeric characters, underscores, dashes, and/or periods.' + 'Database name should only contain alphanumeric characters, underscores, dashes, and/or periods.', ), connectionsFrom: string().matches(/^[\w\-/.%:]+$/, 'A valid host address must be provided.'), }); @@ -89,16 +89,10 @@ export default () => { />
- - +
diff --git a/resources/scripts/components/server/databases/DatabasesContainer.tsx b/resources/scripts/components/server/databases/DatabasesContainer.tsx index 7640048d8..5d40446d1 100644 --- a/resources/scripts/components/server/databases/DatabasesContainer.tsx +++ b/resources/scripts/components/server/databases/DatabasesContainer.tsx @@ -53,23 +53,23 @@ export default () => { // <> ) : ( - <> - {databases.length > 0 ? ( - databases.map((database, index) => ( - 0 ? 'mt-1' : undefined} - /> - )) - ) : ( -

- {databaseLimit > 0 - ? 'It looks like you have no databases.' - : 'Databases cannot be created for this server.'} -

- )} - + <> + {databases.length > 0 ? ( + databases.map((database, index) => ( + 0 ? 'mt-1' : undefined} + /> + )) + ) : ( +

+ {databaseLimit > 0 + ? 'It looks like you have no databases.' + : 'Databases cannot be created for this server.'} +

+ )} + )} ); diff --git a/resources/scripts/components/server/features/GSLTokenModalFeature.tsx b/resources/scripts/components/server/features/GSLTokenModalFeature.tsx index dcc0bb851..c2c19751a 100644 --- a/resources/scripts/components/server/features/GSLTokenModalFeature.tsx +++ b/resources/scripts/components/server/features/GSLTokenModalFeature.tsx @@ -91,9 +91,7 @@ const GSLTokenModalFeature = () => { />
- +
diff --git a/resources/scripts/components/server/features/JavaVersionModalFeature.tsx b/resources/scripts/components/server/features/JavaVersionModalFeature.tsx index b685b3328..d20e07f27 100644 --- a/resources/scripts/components/server/features/JavaVersionModalFeature.tsx +++ b/resources/scripts/components/server/features/JavaVersionModalFeature.tsx @@ -100,7 +100,7 @@ const JavaVersionModalFeature = () => {
- diff --git a/resources/scripts/components/server/features/PIDLimitModalFeature.tsx b/resources/scripts/components/server/features/PIDLimitModalFeature.tsx index 0e753e5eb..216f9ff45 100644 --- a/resources/scripts/components/server/features/PIDLimitModalFeature.tsx +++ b/resources/scripts/components/server/features/PIDLimitModalFeature.tsx @@ -61,8 +61,8 @@ const PIDLimitModalFeature = () => {

This server has reached the maximum process or memory limit.

Increasing container_pid_limit in the wings - configuration, config.yml, might help resolve this - issue. + configuration, config.yml, might help resolve + this issue.

Note: Wings must be restarted for the configuration file changes to take effect diff --git a/resources/scripts/components/server/features/SteamDiskSpaceFeature.tsx b/resources/scripts/components/server/features/SteamDiskSpaceFeature.tsx index c13f999b0..d16c3a8f3 100644 --- a/resources/scripts/components/server/features/SteamDiskSpaceFeature.tsx +++ b/resources/scripts/components/server/features/SteamDiskSpaceFeature.tsx @@ -57,13 +57,11 @@ const SteamDiskSpaceFeature = () => {

Ensure the machine has enough disk space by typing{' '} - df -h on the machine hosting this - server. Delete files or increase the available disk space to resolve the issue. + df -h on the machine hosting + this server. Delete files or increase the available disk space to resolve the issue.

- +
) : ( @@ -76,9 +74,7 @@ const SteamDiskSpaceFeature = () => { process. Please get in touch with the administrator(s) and inform them of disk space issues.

- +
)} diff --git a/resources/scripts/components/server/features/eula/EulaModalFeature.tsx b/resources/scripts/components/server/features/eula/EulaModalFeature.tsx index 81002836c..949e78de0 100644 --- a/resources/scripts/components/server/features/eula/EulaModalFeature.tsx +++ b/resources/scripts/components/server/features/eula/EulaModalFeature.tsx @@ -81,9 +81,7 @@ const EulaModalFeature = () => { - +
); diff --git a/resources/scripts/components/server/files/ChmodFileModal.tsx b/resources/scripts/components/server/files/ChmodFileModal.tsx index c83359e05..7a8c0630b 100644 --- a/resources/scripts/components/server/files/ChmodFileModal.tsx +++ b/resources/scripts/components/server/files/ChmodFileModal.tsx @@ -33,9 +33,9 @@ const ChmodFileModal = ({ files, ...props }: OwnProps) => { await mutate( (data) => data!.map((f) => - f.name === files[0]?.file ? { ...f, mode: fileBitsToString(mode, !f.isFile), modeBits: mode } : f + f.name === files[0]?.file ? { ...f, mode: fileBitsToString(mode, !f.isFile), modeBits: mode } : f, ), - false + false, ); const data = files.map((f) => ({ file: f.file, mode: mode })); diff --git a/resources/scripts/components/server/files/FileEditContainer.tsx b/resources/scripts/components/server/files/FileEditContainer.tsx index c25d9cd6f..9bf31e519 100644 --- a/resources/scripts/components/server/files/FileEditContainer.tsx +++ b/resources/scripts/components/server/files/FileEditContainer.tsx @@ -130,7 +130,7 @@ export default () => { />
*/}
- Note: File editing is currently disabled while we migrate pyrodactyl's built-in editor to a newer + Note: File editing is currently disabled while we migrate pyrodactyl's built-in editor to a newer version. This message is here to prevent errors on your end. Thanks for your patience!
{/*
diff --git a/resources/scripts/components/server/files/FileManagerStatus.tsx b/resources/scripts/components/server/files/FileManagerStatus.tsx index b064a6b70..2ecf73f3b 100644 --- a/resources/scripts/components/server/files/FileManagerStatus.tsx +++ b/resources/scripts/components/server/files/FileManagerStatus.tsx @@ -100,7 +100,7 @@ export default () => { cy='12' r='10' stroke='currentColor' - stroke-width='4' + strokeWidth='4' > { const fileUploadInput = useRef(null); - const [timeouts, setTimeouts] = useState([]); + const [timeouts, _] = useState([]); const [visible, setVisible] = useState(false); const { mutate } = useFileManagerSwr(); const { addError, clearAndAddHttpError } = useFlashKey('files'); @@ -133,8 +133,8 @@ export default () => { fill='white' /> diff --git a/resources/scripts/components/server/schedules/ScheduleContainer.tsx b/resources/scripts/components/server/schedules/ScheduleContainer.tsx index e0f79a661..5304825e9 100644 --- a/resources/scripts/components/server/schedules/ScheduleContainer.tsx +++ b/resources/scripts/components/server/schedules/ScheduleContainer.tsx @@ -1,17 +1,14 @@ import { useEffect, useState } from 'react'; import getServerSchedules from '@/api/server/schedules/getServerSchedules'; import { ServerContext } from '@/state/server'; -import Spinner from '@/components/elements/Spinner'; import FlashMessageRender from '@/components/FlashMessageRender'; import ScheduleRow from '@/components/server/schedules/ScheduleRow'; import { httpErrorToHuman } from '@/api/http'; import EditScheduleModal from '@/components/server/schedules/EditScheduleModal'; import Can from '@/components/elements/Can'; import useFlash from '@/plugins/useFlash'; -import GreyRowBox from '@/components/elements/GreyRowBox'; -import { Button } from '@/components/elements/button/index'; import ServerContentBlock from '@/components/elements/ServerContentBlock'; -import { Link, NavLink } from 'react-router-dom'; +import { NavLink } from 'react-router-dom'; function ScheduleContainer() { const uuid = ServerContext.useStoreState((state) => state.server.data!.uuid); diff --git a/resources/scripts/components/server/schedules/ScheduleEditContainer.tsx b/resources/scripts/components/server/schedules/ScheduleEditContainer.tsx index 6304dec23..6e89f7e7c 100644 --- a/resources/scripts/components/server/schedules/ScheduleEditContainer.tsx +++ b/resources/scripts/components/server/schedules/ScheduleEditContainer.tsx @@ -26,10 +26,10 @@ const CronBox = ({ title, value }: { title: string; value: string }) => ( const ActivePill = ({ active }: { active: boolean }) => ( {active ? 'Active' : 'Inactive'} @@ -48,7 +48,7 @@ export default () => { const schedule = ServerContext.useStoreState( (st) => st.schedules.data.find((s) => s.id === Number(scheduleId)), - isEqual + isEqual, ); const appendSchedule = ServerContext.useStoreActions((actions) => actions.schedules.appendSchedule); @@ -134,7 +134,7 @@ export default () => { {schedule.tasks.length > 0 ? schedule.tasks .sort((a, b) => - a.sequenceId === b.sequenceId ? 0 : a.sequenceId > b.sequenceId ? 1 : -1 + a.sequenceId === b.sequenceId ? 0 : a.sequenceId > b.sequenceId ? 1 : -1, ) .map((task) => ( { appendSchedule({ ...schedule, tasks: schedule.tasks.filter((t) => t.id !== task.id), - }) + }), ) .catch((error) => { console.error(error); @@ -91,7 +91,9 @@ export default ({ schedule, task }: Props) => {
{task.continueOnFailure && (
-
+
Continues on Failure
diff --git a/resources/scripts/components/server/settings/RenameServerBox.tsx b/resources/scripts/components/server/settings/RenameServerBox.tsx index 7ef9a97c9..f67b2fbe6 100644 --- a/resources/scripts/components/server/settings/RenameServerBox.tsx +++ b/resources/scripts/components/server/settings/RenameServerBox.tsx @@ -1,6 +1,6 @@ import { ServerContext } from '@/state/server'; import TitledGreyBox from '@/components/elements/TitledGreyBox'; -import { Form, Formik, FormikHelpers } from 'formik'; +import { Form, Formik } from 'formik'; import { toast } from 'sonner'; import { Actions, useStoreActions } from 'easy-peasy'; import renameServer from '@/api/server/renameServer'; diff --git a/resources/scripts/components/server/settings/SettingsContainer.tsx b/resources/scripts/components/server/settings/SettingsContainer.tsx index 3dc5615bd..2d3c8f06f 100644 --- a/resources/scripts/components/server/settings/SettingsContainer.tsx +++ b/resources/scripts/components/server/settings/SettingsContainer.tsx @@ -24,7 +24,7 @@ export default () => {

Settings

- +
diff --git a/resources/scripts/components/server/startup/StartupContainer.tsx b/resources/scripts/components/server/startup/StartupContainer.tsx index 082c91ca6..7f0c128fc 100644 --- a/resources/scripts/components/server/startup/StartupContainer.tsx +++ b/resources/scripts/components/server/startup/StartupContainer.tsx @@ -13,14 +13,14 @@ import isEqual from 'react-fast-compare'; import Input from '@/components/elements/Input'; import setSelectedDockerImage from '@/api/server/setSelectedDockerImage'; import InputSpinner from '@/components/elements/InputSpinner'; -import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuItem, - DropdownMenuRadioGroup, - DropdownMenuRadioItem, - DropdownMenuTrigger, -} from '@/components/elements/DropdownMenu'; +// import { +// DropdownMenu, +// DropdownMenuContent, +// DropdownMenuItem, +// DropdownMenuRadioGroup, +// DropdownMenuRadioItem, +// DropdownMenuTrigger, +// } from '@/components/elements/DropdownMenu'; import useFlash from '@/plugins/useFlash'; import CopyOnClick from '@/components/elements/CopyOnClick'; diff --git a/resources/scripts/components/server/startup/VariableBox.tsx b/resources/scripts/components/server/startup/VariableBox.tsx index 443e38710..65c1cfe52 100644 --- a/resources/scripts/components/server/startup/VariableBox.tsx +++ b/resources/scripts/components/server/startup/VariableBox.tsx @@ -3,7 +3,6 @@ import { ServerEggVariable } from '@/api/server/types'; import TitledGreyBox from '@/components/elements/TitledGreyBox'; import { usePermissions } from '@/plugins/usePermissions'; import InputSpinner from '@/components/elements/InputSpinner'; -import Input from '@/components/elements/Input'; import Switch from '@/components/elements/Switch'; import debounce from 'debounce'; import updateStartupVariable from '@/api/server/updateStartupVariable'; @@ -59,7 +58,7 @@ const VariableBox = ({ variable }: Props) => { return ( - +
{!variable.isEditable && ( Read Only diff --git a/resources/scripts/components/server/users/AddSubuserButton.tsx b/resources/scripts/components/server/users/AddSubuserButton.tsx index 1abf77870..e52cfa0f6 100644 --- a/resources/scripts/components/server/users/AddSubuserButton.tsx +++ b/resources/scripts/components/server/users/AddSubuserButton.tsx @@ -1,6 +1,5 @@ import { useState } from 'react'; import EditSubuserModal from '@/components/server/users/EditSubuserModal'; -import { Button } from '@/components/elements/button/index'; export default () => { const [visible, setVisible] = useState(false); diff --git a/resources/scripts/components/server/users/EditSubuserModal.tsx b/resources/scripts/components/server/users/EditSubuserModal.tsx index c8ceb08b7..6a3d13888 100644 --- a/resources/scripts/components/server/users/EditSubuserModal.tsx +++ b/resources/scripts/components/server/users/EditSubuserModal.tsx @@ -31,7 +31,7 @@ const EditSubuserModal = ({ subuser }: Props) => { const uuid = ServerContext.useStoreState((state) => state.server.data!.uuid); const appendSubuser = ServerContext.useStoreActions((actions) => actions.subusers.appendSubuser); const { clearFlashes, clearAndAddHttpError } = useStoreActions( - (actions: Actions) => actions.flashes + (actions: Actions) => actions.flashes, ); const { dismiss, setPropOverrides } = useContext(ModalContext); @@ -45,7 +45,7 @@ const EditSubuserModal = ({ subuser }: Props) => { // The permissions that can be modified by this user. const editablePermissions = useDeepCompareMemo(() => { const cleaned = Object.keys(permissions).map((key) => - Object.keys(permissions[key]?.keys ?? {}).map((pkey) => `${key}.${pkey}`) + Object.keys(permissions[key]?.keys ?? {}).map((pkey) => `${key}.${pkey}`), ); const list: string[] = ([] as string[]).concat.apply([], Object.values(cleaned)); @@ -81,7 +81,7 @@ const EditSubuserModal = ({ subuser }: Props) => { () => () => { clearFlashes('user:edit'); }, - [] + [], ); return ( @@ -114,7 +114,7 @@ const EditSubuserModal = ({ subuser }: Props) => {
- + {!isRootAdmin && loggedInPermissions[0] !== '*' && (

diff --git a/resources/scripts/components/server/users/PermissionTitleBox.tsx b/resources/scripts/components/server/users/PermissionTitleBox.tsx index acf6a3573..f15614453 100644 --- a/resources/scripts/components/server/users/PermissionTitleBox.tsx +++ b/resources/scripts/components/server/users/PermissionTitleBox.tsx @@ -22,7 +22,7 @@ const PermissionTitleBox: React.FC = memo(({ isEditable, title, permissio setValue(value.filter((p) => !permissions.includes(p))); } }, - [permissions, value] + [permissions, value], ); return ( diff --git a/resources/scripts/components/server/users/UsersContainer.tsx b/resources/scripts/components/server/users/UsersContainer.tsx index 966e44962..e16f66282 100644 --- a/resources/scripts/components/server/users/UsersContainer.tsx +++ b/resources/scripts/components/server/users/UsersContainer.tsx @@ -2,7 +2,6 @@ import { useEffect, useState } from 'react'; import { ServerContext } from '@/state/server'; import { Actions, useStoreActions, useStoreState } from 'easy-peasy'; import { ApplicationStore } from '@/state'; -import Spinner from '@/components/elements/Spinner'; import AddSubuserButton from '@/components/server/users/AddSubuserButton'; import UserRow from '@/components/server/users/UserRow'; import FlashMessageRender from '@/components/FlashMessageRender'; @@ -49,7 +48,7 @@ export default () => { return ( - +

Users

diff --git a/resources/scripts/context/ModalContext.ts b/resources/scripts/context/ModalContext.ts index 64457463f..6ec51c219 100644 --- a/resources/scripts/context/ModalContext.ts +++ b/resources/scripts/context/ModalContext.ts @@ -7,7 +7,7 @@ export interface ModalContextValues { value: | ((current: Readonly>) => Partial) | Partial - | null + | null, ) => void; } diff --git a/resources/scripts/hoc/asDialog.tsx b/resources/scripts/hoc/asDialog.tsx index b23dd147b..a79a2e12c 100644 --- a/resources/scripts/hoc/asDialog.tsx +++ b/resources/scripts/hoc/asDialog.tsx @@ -2,7 +2,7 @@ import { useState } from 'react'; import { Dialog, DialogProps, DialogWrapperContext, WrapperProps } from '@/components/elements/dialog'; function asDialog( - initialProps?: WrapperProps + initialProps?: WrapperProps, // eslint-disable-next-line @typescript-eslint/ban-types ):

(C: React.ComponentType

) => React.FunctionComponent

{ return function (Component) { diff --git a/resources/scripts/hoc/asModal.tsx b/resources/scripts/hoc/asModal.tsx index 3c49144d8..0fbdea693 100644 --- a/resources/scripts/hoc/asModal.tsx +++ b/resources/scripts/hoc/asModal.tsx @@ -19,7 +19,7 @@ interface State { // eslint-disable-next-line @typescript-eslint/ban-types function asModal

( - modalProps?: SettableModalProps | ((props: P) => SettableModalProps) + modalProps?: SettableModalProps | ((props: P) => SettableModalProps), ): (Component: any) => any { return function (Component) { return class extends PureComponent

{ diff --git a/resources/scripts/index.tsx b/resources/scripts/index.tsx index c6dc2542d..649811ed0 100644 --- a/resources/scripts/index.tsx +++ b/resources/scripts/index.tsx @@ -1,3 +1,5 @@ +// I know it's deprecated! We need to fix it!!! +// eslint-disable-next-line react/no-deprecated import { render } from 'react-dom'; import * as Sentry from '@sentry/react'; import App from '@/components/App'; diff --git a/resources/scripts/lib/objects.spec.ts b/resources/scripts/lib/objects.spec.ts index 330b6e954..9a2d42f7d 100644 --- a/resources/scripts/lib/objects.spec.ts +++ b/resources/scripts/lib/objects.spec.ts @@ -16,7 +16,7 @@ describe('@/lib/objects.ts', function () { 'should return false for %p', function (value) { expect(isObject(value)).toBe(false); - } + }, ); }); }); diff --git a/resources/scripts/lib/utils.ts b/resources/scripts/lib/utils.ts index 365058ceb..dd53ea892 100644 --- a/resources/scripts/lib/utils.ts +++ b/resources/scripts/lib/utils.ts @@ -1,6 +1,6 @@ -import { type ClassValue, clsx } from "clsx"; -import { twMerge } from "tailwind-merge"; +import { type ClassValue, clsx } from 'clsx'; +import { twMerge } from 'tailwind-merge'; export function cn(...inputs: ClassValue[]) { - return twMerge(clsx(inputs)); + return twMerge(clsx(inputs)); } diff --git a/resources/scripts/macros.d.ts b/resources/scripts/macros.d.ts index a71078482..410e3bcb9 100644 --- a/resources/scripts/macros.d.ts +++ b/resources/scripts/macros.d.ts @@ -15,10 +15,10 @@ declare module 'styled-components' { T extends object, // eslint-disable-next-line @typescript-eslint/ban-types O extends object = {}, - A extends keyof any = never + A extends keyof any = never, > extends ForwardRefExoticBase> { ( - props: StyledComponentProps & { as?: Element | string; forwardedAs?: never | undefined } + props: StyledComponentProps & { as?: Element | string; forwardedAs?: never | undefined }, ): ReactElement>; } } diff --git a/resources/scripts/plugins/Websocket.ts b/resources/scripts/plugins/Websocket.ts index 48d8dc7e7..74624d657 100644 --- a/resources/scripts/plugins/Websocket.ts +++ b/resources/scripts/plugins/Websocket.ts @@ -100,7 +100,7 @@ export class Websocket extends EventEmitter { JSON.stringify({ event, args: Array.isArray(payload) ? payload : [payload], - }) + }), ); } } diff --git a/resources/scripts/plugins/useEventListener.ts b/resources/scripts/plugins/useEventListener.ts index 3fef05c4c..b552bee19 100644 --- a/resources/scripts/plugins/useEventListener.ts +++ b/resources/scripts/plugins/useEventListener.ts @@ -3,7 +3,7 @@ import { useEffect, useRef } from 'react'; export default ( eventName: string, handler: (e: Event | CustomEvent | UIEvent | any) => void, - options?: boolean | EventListenerOptions + options?: boolean | EventListenerOptions, ) => { const savedHandler = useRef(null); diff --git a/resources/scripts/plugins/useFileManagerSwr.ts b/resources/scripts/plugins/useFileManagerSwr.ts index a03ccaefb..ab0712585 100644 --- a/resources/scripts/plugins/useFileManagerSwr.ts +++ b/resources/scripts/plugins/useFileManagerSwr.ts @@ -17,6 +17,6 @@ export default () => { revalidateOnMount: false, refreshInterval: 0, errorRetryCount: 2, - } + }, ); }; diff --git a/resources/scripts/plugins/usePermissions.ts b/resources/scripts/plugins/usePermissions.ts index e3e646ec3..ddc31daf0 100644 --- a/resources/scripts/plugins/usePermissions.ts +++ b/resources/scripts/plugins/usePermissions.ts @@ -16,7 +16,7 @@ export const usePermissions = (action: string | string[]): boolean[] => { (permission.endsWith('.*') && userPermissions.filter((p) => p.startsWith(permission.split('.')?.[0] ?? '')).length > 0) || // Otherwise just check if the entire permission exists in the array or not. - userPermissions.indexOf(permission) >= 0 + userPermissions.indexOf(permission) >= 0, ); }, [action, userPermissions]); }; diff --git a/resources/scripts/plugins/usePersistedState.ts b/resources/scripts/plugins/usePersistedState.ts index f5d247677..bffcfb1f0 100644 --- a/resources/scripts/plugins/usePersistedState.ts +++ b/resources/scripts/plugins/usePersistedState.ts @@ -2,7 +2,7 @@ import { Dispatch, SetStateAction, useEffect, useState } from 'react'; export function usePersistedState( key: string, - defaultValue: S + defaultValue: S, ): [S | undefined, Dispatch>] { const [state, setState] = useState(() => { try { diff --git a/vite.config.ts b/vite.config.ts index 8f0e2ba5c..40b32c849 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -43,6 +43,7 @@ export default defineConfig({ manualChunks(id) { if (id.includes('node_modules')) { // @ts-expect-error + // It won't fail lol return id.toString().split('node_modules/')[1].split('/')[0].toString(); } },