mirror of
https://github.com/ajnart/homarr.git
synced 2026-02-27 00:40:58 +01:00
chore(deps): update dependency eslint to v9 (#452)
* chore(deps): update dependency eslint to v9 * chore: migrate eslint to v9 * fix: dependency issues * fix: unit tests not working * chore: disable lint check for Image component that does not work in ci * fix: lint issue --------- Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com> Co-authored-by: Meier Lukas <meierschlumpf@gmail.com>
This commit is contained in:
committed by
GitHub
parent
d7ecdf5567
commit
1bae7352dc
21
.vscode/settings.json
vendored
21
.vscode/settings.json
vendored
@@ -4,24 +4,15 @@
|
||||
"mode": "auto"
|
||||
}
|
||||
],
|
||||
"eslint.experimental.useFlatConfig": true,
|
||||
"typescript.tsdk": "node_modules\\typescript\\lib",
|
||||
"js/ts.implicitProjectConfig.experimentalDecorators": true,
|
||||
"prettier.configPath": "./tooling/prettier/index.mjs",
|
||||
"cSpell.words": [
|
||||
"cqmin",
|
||||
"homarr",
|
||||
"superjson",
|
||||
"trpc",
|
||||
"Umami"
|
||||
],
|
||||
"cSpell.words": ["cqmin", "homarr", "superjson", "trpc", "Umami"],
|
||||
"i18n-ally.dirStructure": "auto",
|
||||
"i18n-ally.enabledFrameworks": [
|
||||
"next-international"
|
||||
],
|
||||
"i18n-ally.localesPaths": [
|
||||
"./packages/translation/src/lang/",
|
||||
],
|
||||
"i18n-ally.enabledFrameworks": ["next-international"],
|
||||
"i18n-ally.localesPaths": ["./packages/translation/src/lang/"],
|
||||
"i18n-ally.enabledParsers": ["ts"],
|
||||
"i18n-ally.extract.keyMaxLength": 0,
|
||||
"i18n-ally.keystyle": "flat",
|
||||
}
|
||||
"i18n-ally.keystyle": "flat"
|
||||
}
|
||||
|
||||
13
apps/nextjs/eslint.config.js
Normal file
13
apps/nextjs/eslint.config.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import baseConfig from "@homarr/eslint-config/base";
|
||||
import nextjsConfig from "@homarr/eslint-config/nextjs";
|
||||
import reactConfig from "@homarr/eslint-config/react";
|
||||
|
||||
/** @type {import('typescript-eslint').Config} */
|
||||
export default [
|
||||
{
|
||||
ignores: [".next/**"],
|
||||
},
|
||||
...baseConfig,
|
||||
...reactConfig,
|
||||
...nextjsConfig,
|
||||
];
|
||||
@@ -10,12 +10,10 @@ const config = {
|
||||
eslint: { ignoreDuringBuilds: true },
|
||||
typescript: { ignoreBuildErrors: true },
|
||||
webpack: (config) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
|
||||
config.module.rules.push({
|
||||
test: /\.node$/,
|
||||
loader: "node-loader",
|
||||
});
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
||||
return config;
|
||||
},
|
||||
experimental: {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
"build": "pnpm with-env next build",
|
||||
"clean": "git clean -xdf .next .turbo node_modules",
|
||||
"dev": "pnpm with-env next dev",
|
||||
"lint": "dotenv -v SKIP_ENV_VALIDATION=1 next lint",
|
||||
"lint": "eslint",
|
||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
||||
"start": "pnpm with-env next start",
|
||||
"typecheck": "tsc --noEmit",
|
||||
@@ -73,19 +73,11 @@
|
||||
"@types/react": "^18.3.3",
|
||||
"@types/react-dom": "^18.3.0",
|
||||
"concurrently": "^8.2.2",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint": "^9.4.0",
|
||||
"node-loader": "^2.0.0",
|
||||
"prettier": "^3.3.1",
|
||||
"tsx": "4.14.0",
|
||||
"typescript": "^5.4.5"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"root": true,
|
||||
"extends": [
|
||||
"@homarr/eslint-config/base",
|
||||
"@homarr/eslint-config/nextjs",
|
||||
"@homarr/eslint-config/react"
|
||||
]
|
||||
},
|
||||
"prettier": "@homarr/prettier-config"
|
||||
}
|
||||
|
||||
@@ -49,7 +49,6 @@ export const BoardProvider = ({
|
||||
|
||||
useEffect(() => {
|
||||
setReadySections((previous) => previous.filter((id) => data.sections.some((section) => section.id === id)));
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [data.sections.length, setReadySections]);
|
||||
|
||||
const markAsReady = useCallback((id: string) => {
|
||||
|
||||
@@ -33,6 +33,7 @@ export const generateColors = (hex: string) => {
|
||||
return rgbaColors.map((color) => {
|
||||
return (
|
||||
"#" +
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
color
|
||||
.split("(")[1]!
|
||||
.replaceAll(" ", "")
|
||||
|
||||
@@ -81,6 +81,7 @@ export const GroupsForm = ({ board, initialPermissions, onCountChange }: FormPro
|
||||
{form.values.items.map((row, index) => (
|
||||
<BoardAccessSelectRow
|
||||
key={row.itemId}
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
itemContent={<GroupItemContent group={groups.get(row.itemId)!} />}
|
||||
permission={row.permission}
|
||||
index={index}
|
||||
|
||||
@@ -93,6 +93,7 @@ export const UsersForm = ({ board, initialPermissions, onCountChange }: FormProp
|
||||
{form.values.items.map((row, index) => (
|
||||
<BoardAccessSelectRow
|
||||
key={row.itemId}
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
itemContent={<UserItemContent user={users.get(row.itemId)!} />}
|
||||
permission={row.permission}
|
||||
index={index}
|
||||
|
||||
@@ -6,7 +6,6 @@ export const composeWrappers = (
|
||||
wrappers: React.FunctionComponent<PropsWithChildren>[],
|
||||
): React.FunctionComponent<PropsWithChildren> => {
|
||||
return wrappers.reverse().reduce((Acc, Current): React.FunctionComponent<PropsWithChildren> => {
|
||||
// eslint-disable-next-line react/display-name
|
||||
return (props) => (
|
||||
<Current>
|
||||
<Acc {...props} />
|
||||
|
||||
@@ -21,11 +21,11 @@ import { setStaticParamsLocale } from "next-international/server";
|
||||
|
||||
import { getScopedI18n, getStaticParams } from "@homarr/translation/server";
|
||||
|
||||
import { homarrLogoPath } from "~/components/layout/logo/homarr-logo";
|
||||
import { createMetaTitle } from "~/metadata";
|
||||
import { getPackageAttributesAsync } from "~/versions/package-reader";
|
||||
import contributorsData from "../../../../../../../static-data/contributors.json";
|
||||
import translatorsData from "../../../../../../../static-data/translators.json";
|
||||
import logo from "../../../../../public/logo/logo.png";
|
||||
import classes from "./about.module.css";
|
||||
|
||||
export async function generateMetadata() {
|
||||
@@ -50,7 +50,7 @@ export default async function AboutPage({ params: { locale } }: PageProps) {
|
||||
<div>
|
||||
<Center w="100%">
|
||||
<Group py="lg">
|
||||
<Image src={logo} width={100} height={100} alt="" />
|
||||
<Image src={homarrLogoPath} width={100} height={100} alt="" />
|
||||
<Stack gap={0}>
|
||||
<Title order={1} tt="uppercase">
|
||||
Homarr
|
||||
|
||||
@@ -83,7 +83,7 @@ const BoardCard = async ({ board }: BoardCardProps) => {
|
||||
{board.creator && (
|
||||
<Group gap="xs">
|
||||
<UserAvatar user={board.creator} size="sm" />
|
||||
<Text>{board.creator?.name}</Text>
|
||||
<Text>{board.creator.name}</Text>
|
||||
</Group>
|
||||
)}
|
||||
</Group>
|
||||
|
||||
@@ -95,6 +95,7 @@ export const EditIntegrationForm = ({ integration }: EditIntegrationForm) => {
|
||||
{secretsKinds.map((kind, index) => (
|
||||
<SecretCard
|
||||
key={kind}
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
secret={secretsMap.get(kind)!}
|
||||
onCancel={() =>
|
||||
new Promise((res) => {
|
||||
@@ -107,7 +108,7 @@ export const EditIntegrationForm = ({ integration }: EditIntegrationForm) => {
|
||||
children: t("integration.secrets.reset.message"),
|
||||
onCancel: () => res(false),
|
||||
onConfirm: () => {
|
||||
form.setFieldValue(`secrets.${index}.value`, secretsMap.get(kind)!.value ?? "");
|
||||
form.setFieldValue(`secrets.${index}.value`, secretsMap.get(kind)?.value ?? "");
|
||||
res(true);
|
||||
},
|
||||
});
|
||||
|
||||
@@ -17,6 +17,7 @@ interface NewIntegrationPageProps {
|
||||
}
|
||||
|
||||
export default async function IntegrationsNewPage({ searchParams }: NewIntegrationPageProps) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
const result = z.enum([integrationKinds[0]!, ...integrationKinds.slice(1)]).safeParse(searchParams.kind);
|
||||
if (!result.success) {
|
||||
notFound();
|
||||
|
||||
@@ -82,6 +82,7 @@ const IntegrationList = async ({ integrations, activeTab }: IntegrationListProps
|
||||
|
||||
const grouppedIntegrations = integrations.reduce(
|
||||
(acc, integration) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||
if (!acc[integration.kind]) {
|
||||
acc[integration.kind] = [];
|
||||
}
|
||||
|
||||
@@ -136,6 +136,6 @@ const fileToBase64Async = async (file: File): Promise<string> =>
|
||||
new Promise((resolve, reject) => {
|
||||
const reader = new FileReader();
|
||||
reader.readAsDataURL(file);
|
||||
reader.onload = () => resolve(reader.result?.toString() || "");
|
||||
reader.onload = () => resolve(reader.result?.toString() ?? "");
|
||||
reader.onerror = reject;
|
||||
});
|
||||
|
||||
@@ -35,7 +35,7 @@ export async function generateMetadata({ params }: Props) {
|
||||
const t = await getScopedI18n("management.page.user.edit");
|
||||
|
||||
return {
|
||||
title: createMetaTitle(t("metaTitle", { username: user?.name })),
|
||||
title: createMetaTitle(t("metaTitle", { username: user.name })),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,8 @@ export const UserCreateStepperComponent = () => {
|
||||
|
||||
const allForms = useMemo(() => [generalForm, securityForm], [generalForm, securityForm]);
|
||||
|
||||
const isCurrentFormValid = allForms[active] ? (allForms[active]!.isValid satisfies () => boolean) : () => true;
|
||||
const activeForm = allForms[active];
|
||||
const isCurrentFormValid = activeForm ? activeForm.isValid : () => true;
|
||||
const canNavigateToNextStep = isCurrentFormValid();
|
||||
|
||||
const controlledGoToNextStep = useCallback(async () => {
|
||||
|
||||
@@ -24,7 +24,8 @@ export default async function GroupsDetailPage({ params, searchParams }: GroupsD
|
||||
const group = await api.group.getById({ id: params.id });
|
||||
|
||||
const filteredMembers = searchParams.search
|
||||
? group.members.filter((member) => member.name?.toLowerCase().includes(searchParams.search!.trim().toLowerCase()))
|
||||
? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
group.members.filter((member) => member.name?.toLowerCase().includes(searchParams.search!.trim().toLowerCase()))
|
||||
: group.members;
|
||||
|
||||
return (
|
||||
|
||||
@@ -90,7 +90,6 @@ export const useItemActions = () => {
|
||||
const updateItemOptions = useCallback(
|
||||
({ itemId, newOptions }: UpdateItemOptions) => {
|
||||
updateBoard((previous) => {
|
||||
if (!previous) return previous;
|
||||
return {
|
||||
...previous,
|
||||
sections: previous.sections.map((section) => {
|
||||
@@ -117,7 +116,6 @@ export const useItemActions = () => {
|
||||
const updateItemAdvancedOptions = useCallback(
|
||||
({ itemId, newAdvancedOptions }: UpdateItemAdvancedOptions) => {
|
||||
updateBoard((previous) => {
|
||||
if (!previous) return previous;
|
||||
return {
|
||||
...previous,
|
||||
sections: previous.sections.map((section) => {
|
||||
@@ -144,7 +142,6 @@ export const useItemActions = () => {
|
||||
const updateItemIntegrations = useCallback(
|
||||
({ itemId, newIntegrations }: UpdateItemIntegrations) => {
|
||||
updateBoard((previous) => {
|
||||
if (!previous) return previous;
|
||||
return {
|
||||
...previous,
|
||||
sections: previous.sections.map((section) => {
|
||||
|
||||
@@ -37,6 +37,7 @@ export const useCategoryActions = () => {
|
||||
sections: [
|
||||
// Place sections before the new category
|
||||
...previous.sections.filter(
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||
(section) => (section.kind === "category" || section.kind === "empty") && section.position < position,
|
||||
),
|
||||
{
|
||||
@@ -56,6 +57,7 @@ export const useCategoryActions = () => {
|
||||
...previous.sections
|
||||
.filter(
|
||||
(section): section is CategorySection | EmptySection =>
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||
(section.kind === "category" || section.kind === "empty") && section.position >= position,
|
||||
)
|
||||
.map((section) => ({
|
||||
@@ -74,6 +76,7 @@ export const useCategoryActions = () => {
|
||||
const lastSection = previous.sections
|
||||
.filter(
|
||||
(section): section is CategorySection | EmptySection =>
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||
section.kind === "empty" || section.kind === "category",
|
||||
)
|
||||
.sort((sectionA, sectionB) => sectionB.position - sectionA.position)
|
||||
@@ -130,12 +133,13 @@ export const useCategoryActions = () => {
|
||||
(section): section is CategorySection => section.kind === "category" && section.id === id,
|
||||
);
|
||||
if (!currentCategory) return previous;
|
||||
if (currentCategory?.position === 1 && direction === "up") return previous;
|
||||
if (currentCategory?.position === previous.sections.length - 2 && direction === "down") return previous;
|
||||
if (currentCategory.position === 1 && direction === "up") return previous;
|
||||
if (currentCategory.position === previous.sections.length - 2 && direction === "down") return previous;
|
||||
|
||||
return {
|
||||
...previous,
|
||||
sections: previous.sections.map((section) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||
if (section.kind !== "category" && section.kind !== "empty") return section;
|
||||
const offset = direction === "up" ? -2 : 2;
|
||||
// Move category and empty section
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
/* eslint-disable react/no-unknown-property */
|
||||
// Ignored because of gridstack attributes
|
||||
|
||||
import type { RefObject } from "react";
|
||||
import { useEffect, useMemo, useRef } from "react";
|
||||
import { ActionIcon, Card, Menu } from "@mantine/core";
|
||||
@@ -122,6 +119,7 @@ const BoardItemContent = ({ item, ...dimensions }: ItemContentProps) => {
|
||||
<Comp
|
||||
options={options as never}
|
||||
integrationIds={item.integrationIds}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||
serverData={serverData?.data as never}
|
||||
isEditMode={isEditMode}
|
||||
boardId={board.id}
|
||||
|
||||
@@ -37,7 +37,7 @@ export const initializeGridstack = ({ section, refs, sectionColumnCount }: Initi
|
||||
`.grid-stack-${section.kind}[data-section-id='${section.id}']`,
|
||||
);
|
||||
const grid = newGrid.current;
|
||||
if (!grid) return false;
|
||||
|
||||
// Must be used to update the column count after the initialization
|
||||
grid.column(sectionColumnCount, "none");
|
||||
|
||||
|
||||
@@ -54,15 +54,15 @@ export const useGridstack = ({ section, mainRef }: UseGridstackProps): UseGrista
|
||||
const onChange = useCallback(
|
||||
(changedNode: GridStackNode) => {
|
||||
const itemId = changedNode.el?.getAttribute("data-id");
|
||||
if (!itemId) return;
|
||||
if (!itemId || !changedNode.x || !changedNode.y || !changedNode.w || !changedNode.h) return;
|
||||
|
||||
// Updates the react-query state
|
||||
moveAndResizeItem({
|
||||
itemId,
|
||||
xOffset: changedNode.x!,
|
||||
yOffset: changedNode.y!,
|
||||
width: changedNode.w!,
|
||||
height: changedNode.h!,
|
||||
xOffset: changedNode.x,
|
||||
yOffset: changedNode.y,
|
||||
width: changedNode.w,
|
||||
height: changedNode.h,
|
||||
});
|
||||
},
|
||||
[moveAndResizeItem],
|
||||
@@ -70,16 +70,16 @@ export const useGridstack = ({ section, mainRef }: UseGridstackProps): UseGrista
|
||||
const onAdd = useCallback(
|
||||
(addedNode: GridStackNode) => {
|
||||
const itemId = addedNode.el?.getAttribute("data-id");
|
||||
if (!itemId) return;
|
||||
if (!itemId || !addedNode.x || !addedNode.y || !addedNode.w || !addedNode.h) return;
|
||||
|
||||
// Updates the react-query state
|
||||
moveItemToSection({
|
||||
itemId,
|
||||
sectionId: section.id,
|
||||
xOffset: addedNode.x!,
|
||||
yOffset: addedNode.y!,
|
||||
width: addedNode.w!,
|
||||
height: addedNode.h!,
|
||||
xOffset: addedNode.x,
|
||||
yOffset: addedNode.y,
|
||||
width: addedNode.w,
|
||||
height: addedNode.h,
|
||||
});
|
||||
},
|
||||
[moveItemToSection, section.id],
|
||||
@@ -121,7 +121,6 @@ export const useGridstack = ({ section, mainRef }: UseGridstackProps): UseGrista
|
||||
}
|
||||
|
||||
// Only run this effect when the section items change
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [items.length, section.items.length, board.columnCount]);
|
||||
|
||||
return {
|
||||
|
||||
@@ -20,11 +20,11 @@ export const useOptionalBackgroundProps = (): Partial<AppShellProps> => {
|
||||
}
|
||||
|
||||
return {
|
||||
bg: `url(${board?.backgroundImageUrl})`,
|
||||
bg: `url(${board.backgroundImageUrl})`,
|
||||
bgp: "center center",
|
||||
bgsz: board?.backgroundImageSize ?? "cover",
|
||||
bgr: board?.backgroundImageRepeat ?? "no-repeat",
|
||||
bga: board?.backgroundImageAttachment ?? "fixed",
|
||||
bgsz: board.backgroundImageSize,
|
||||
bgr: board.backgroundImageRepeat,
|
||||
bga: board.backgroundImageAttachment,
|
||||
};
|
||||
};
|
||||
|
||||
@@ -49,7 +49,7 @@ export const BoardBackgroundVideo = () => {
|
||||
height: "100vh",
|
||||
top: 0,
|
||||
left: 0,
|
||||
objectFit: board.backgroundImageSize ?? "cover",
|
||||
objectFit: board.backgroundImageSize,
|
||||
}}
|
||||
>
|
||||
<source src={board.backgroundImageUrl} type={`video/${videoFormat}`} />
|
||||
|
||||
@@ -22,7 +22,6 @@ const headerButtonActionIconProps: ActionIconProps = {
|
||||
size: "lg",
|
||||
};
|
||||
|
||||
// eslint-disable-next-line react/display-name
|
||||
export const HeaderButton = forwardRef<HTMLButtonElement, HeaderButtonProps>((props, ref) => {
|
||||
if ("href" in props) {
|
||||
return (
|
||||
|
||||
@@ -72,7 +72,7 @@ export const UserAvatarMenu = ({ children }: UserAvatarMenuProps) => {
|
||||
<>
|
||||
<Menu.Item
|
||||
component={Link}
|
||||
href={`/manage/users/${session.data?.user?.id}`}
|
||||
href={`/manage/users/${session.data?.user.id}`}
|
||||
leftSection={<IconSettings size="1rem" />}
|
||||
>
|
||||
{t("preferences")}
|
||||
|
||||
@@ -17,7 +17,8 @@ export const UserAvatar = async ({ size }: UserAvatarProps) => {
|
||||
|
||||
if (!currentSession?.user) return <Avatar {...commonProps} />;
|
||||
if (currentSession.user.image)
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
return <Avatar {...commonProps} src={currentSession.user.image} alt={currentSession.user.name!} />;
|
||||
|
||||
return <Avatar {...commonProps}>{currentSession.user.name!.substring(0, 2).toUpperCase()}</Avatar>;
|
||||
return <Avatar {...commonProps}>{currentSession.user.name?.substring(0, 2).toUpperCase()}</Avatar>;
|
||||
};
|
||||
|
||||
9
apps/tasks/eslint.config.js
Normal file
9
apps/tasks/eslint.config.js
Normal file
@@ -0,0 +1,9 @@
|
||||
import baseConfig from "@homarr/eslint-config/base";
|
||||
|
||||
/** @type {import('typescript-eslint').Config} */
|
||||
export default [
|
||||
{
|
||||
ignores: ["build/**"],
|
||||
},
|
||||
...baseConfig,
|
||||
];
|
||||
@@ -13,7 +13,7 @@
|
||||
"dev": "pnpm with-env tsx ./src/main.ts",
|
||||
"build": "esbuild src/main.ts --bundle --platform=node --outfile=tasks.cjs",
|
||||
"clean": "rm -rf .turbo node_modules",
|
||||
"lint": "eslint .",
|
||||
"lint": "eslint",
|
||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"with-env": "dotenv -e ../../.env --"
|
||||
@@ -40,16 +40,10 @@
|
||||
"@types/node-cron": "^3.0.11",
|
||||
"@types/node": "^20.14.2",
|
||||
"dotenv-cli": "^7.4.2",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint": "^9.4.0",
|
||||
"prettier": "^3.3.1",
|
||||
"tsx": "4.14.0",
|
||||
"typescript": "^5.4.5"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"root": true,
|
||||
"extends": [
|
||||
"@homarr/eslint-config/base"
|
||||
]
|
||||
},
|
||||
"prettier": "@homarr/prettier-config"
|
||||
}
|
||||
|
||||
4
apps/websocket/eslint.config.js
Normal file
4
apps/websocket/eslint.config.js
Normal file
@@ -0,0 +1,4 @@
|
||||
import baseConfig from "@homarr/eslint-config/base";
|
||||
|
||||
/** @type {import('typescript-eslint').Config} */
|
||||
export default [...baseConfig];
|
||||
@@ -10,7 +10,7 @@
|
||||
"dev": "pnpm with-env tsx ./src/main.ts",
|
||||
"build": "esbuild src/main.ts --bundle --platform=node --outfile=wssServer.cjs --external:bcrypt --loader:.html=text --loader:.node=text",
|
||||
"clean": "rm -rf .turbo node_modules",
|
||||
"lint": "eslint .",
|
||||
"lint": "eslint",
|
||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"with-env": "dotenv -e ../../.env --"
|
||||
@@ -32,15 +32,9 @@
|
||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||
"@types/ws": "^8.5.10",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint": "^9.4.0",
|
||||
"prettier": "^3.3.1",
|
||||
"typescript": "^5.4.5"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"root": true,
|
||||
"extends": [
|
||||
"@homarr/eslint-config/base"
|
||||
]
|
||||
},
|
||||
"prettier": "@homarr/prettier-config"
|
||||
}
|
||||
|
||||
4
packages/analytics/eslint.config.js
Normal file
4
packages/analytics/eslint.config.js
Normal file
@@ -0,0 +1,4 @@
|
||||
import baseConfig from "@homarr/eslint-config/base";
|
||||
|
||||
/** @type {import('typescript-eslint').Config} */
|
||||
export default [...baseConfig];
|
||||
@@ -16,7 +16,7 @@
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"clean": "rm -rf .turbo node_modules",
|
||||
"lint": "eslint .",
|
||||
"lint": "eslint",
|
||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
@@ -27,14 +27,9 @@
|
||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
||||
"@homarr/server-settings": "workspace:^0.1.0",
|
||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint": "^9.4.0",
|
||||
"typescript": "^5.4.5"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": [
|
||||
"@homarr/eslint-config/base"
|
||||
]
|
||||
},
|
||||
"prettier": "@homarr/prettier-config",
|
||||
"dependencies": {
|
||||
"@umami/node": "^0.3.0",
|
||||
|
||||
4
packages/api/eslint.config.js
Normal file
4
packages/api/eslint.config.js
Normal file
@@ -0,0 +1,4 @@
|
||||
import baseConfig from "@homarr/eslint-config/base";
|
||||
|
||||
/** @type {import('typescript-eslint').Config} */
|
||||
export default [...baseConfig];
|
||||
@@ -14,7 +14,7 @@
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"clean": "rm -rf .turbo node_modules",
|
||||
"lint": "eslint .",
|
||||
"lint": "eslint",
|
||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
@@ -40,15 +40,9 @@
|
||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||
"@types/dockerode": "^3.3.29",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint": "^9.4.0",
|
||||
"prettier": "^3.3.1",
|
||||
"typescript": "^5.4.5"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"root": true,
|
||||
"extends": [
|
||||
"@homarr/eslint-config/base"
|
||||
]
|
||||
},
|
||||
"prettier": "@homarr/prettier-config"
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ function sanitizeContainers(
|
||||
): DockerContainer[] {
|
||||
return containers.map((container) => {
|
||||
return {
|
||||
name: container.Names[0]?.split("/")[1] || "Unknown",
|
||||
name: container.Names[0]?.split("/")[1] ?? "Unknown",
|
||||
id: container.Id,
|
||||
instance: container.instance,
|
||||
state: container.State as DockerContainerState,
|
||||
|
||||
@@ -28,7 +28,7 @@ export class DockerSingleton {
|
||||
host: `${host}:${ports[i]}`,
|
||||
instance: new Docker({
|
||||
host,
|
||||
port: parseInt(ports[i] || "", 10),
|
||||
port: parseInt(ports[i] ?? "", 10),
|
||||
}),
|
||||
});
|
||||
return instances;
|
||||
@@ -41,6 +41,7 @@ export class DockerSingleton {
|
||||
}
|
||||
|
||||
public static getInstance(): DockerInstance[] {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||
if (!DockerSingleton.instances) {
|
||||
DockerSingleton.instances = new DockerSingleton().createInstances();
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ export const groupRouter = createTRPCRouter({
|
||||
...group,
|
||||
members: group.members.map((member) => member.user),
|
||||
})),
|
||||
totalCount: groupCount[0]!.count,
|
||||
totalCount: groupCount[0]?.count ?? 0,
|
||||
};
|
||||
}),
|
||||
getById: protectedProcedure.input(validation.group.byId).query(async ({ input, ctx }) => {
|
||||
|
||||
@@ -15,7 +15,7 @@ export const iconsRouter = createTRPCRouter({
|
||||
name: true,
|
||||
url: true,
|
||||
},
|
||||
where: input.searchText?.length ?? 0 > 0 ? like(icons.name, `%${input.searchText}%`) : undefined,
|
||||
where: (input.searchText?.length ?? 0) > 0 ? like(icons.name, `%${input.searchText}%`) : undefined,
|
||||
limit: 5,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
import { describe, expect, test, vi } from "vitest";
|
||||
|
||||
import type { Session } from "@homarr/auth";
|
||||
|
||||
@@ -169,7 +169,7 @@ describe("byId should return group by id including members and permissions", ()
|
||||
expect(result.id).toBe(groupId);
|
||||
expect(result.members.length).toBe(1);
|
||||
|
||||
const userKeys = Object.keys(result?.members[0] ?? {});
|
||||
const userKeys = Object.keys(result.members[0] ?? {});
|
||||
expect(userKeys.length).toBe(4);
|
||||
expect(["id", "name", "email", "image"].some((key) => userKeys.includes(key)));
|
||||
expect(result.permissions.length).toBe(1);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
|
||||
import type { Session } from "@homarr/auth";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
import { describe, expect, test, vi } from "vitest";
|
||||
|
||||
import type { Session } from "@homarr/auth";
|
||||
|
||||
@@ -44,13 +44,6 @@ export const userRouter = createTRPCRouter({
|
||||
});
|
||||
}
|
||||
|
||||
if (!dbInvite || dbInvite.expirationDate < new Date()) {
|
||||
throw new TRPCError({
|
||||
code: "FORBIDDEN",
|
||||
message: "Invalid invite",
|
||||
});
|
||||
}
|
||||
|
||||
await checkUsernameAlreadyTakenAndThrowAsync(ctx.db, input.username);
|
||||
|
||||
await createUserAsync(ctx.db, input);
|
||||
|
||||
@@ -18,7 +18,7 @@ export const weatherRouter = createTRPCRouter({
|
||||
maxTemp: weather.daily.temperature_2m_max[index],
|
||||
minTemp: weather.daily.temperature_2m_min[index],
|
||||
};
|
||||
}) ?? [{ time: 0, weatherCode: 404 }],
|
||||
}),
|
||||
};
|
||||
}),
|
||||
});
|
||||
|
||||
@@ -122,7 +122,7 @@ export const protectedProcedure = t.procedure.use(enforceUserIsAuthed);
|
||||
export const permissionRequiredProcedure = {
|
||||
requiresPermission: (permission: GroupPermissionKey) => {
|
||||
return protectedProcedure.use(({ ctx, input, next }) => {
|
||||
if (!ctx.session?.user.permissions.includes(permission)) {
|
||||
if (!ctx.session.user.permissions.includes(permission)) {
|
||||
throw new TRPCError({
|
||||
code: "FORBIDDEN",
|
||||
message: "Permission denied",
|
||||
|
||||
@@ -44,10 +44,8 @@ export const createSignInCallback =
|
||||
async ({ user }) => {
|
||||
if (!isCredentialsRequest) return true;
|
||||
|
||||
if (!user) return true;
|
||||
|
||||
// https://github.com/nextauthjs/next-auth/issues/6106
|
||||
if (!adapter?.createSession) {
|
||||
if (!adapter.createSession) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -56,6 +54,7 @@ export const createSignInCallback =
|
||||
|
||||
await adapter.createSession({
|
||||
sessionToken,
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
userId: user.id!,
|
||||
expires: sessionExpiry,
|
||||
});
|
||||
|
||||
4
packages/auth/eslint.config.js
Normal file
4
packages/auth/eslint.config.js
Normal file
@@ -0,0 +1,4 @@
|
||||
import baseConfig from "@homarr/eslint-config/base";
|
||||
|
||||
/** @type {import('typescript-eslint').Config} */
|
||||
export default [...baseConfig];
|
||||
@@ -16,7 +16,7 @@
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"clean": "rm -rf .turbo node_modules",
|
||||
"lint": "eslint .",
|
||||
"lint": "eslint",
|
||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
@@ -40,15 +40,9 @@
|
||||
"@homarr/definitions": "workspace:^0.1.0",
|
||||
"@types/bcrypt": "5.0.2",
|
||||
"@types/cookies": "0.9.0",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint": "^9.4.0",
|
||||
"prettier": "^3.3.1",
|
||||
"typescript": "^5.4.5"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"root": true,
|
||||
"extends": [
|
||||
"@homarr/eslint-config/base"
|
||||
]
|
||||
},
|
||||
"prettier": "@homarr/prettier-config"
|
||||
}
|
||||
|
||||
@@ -23,14 +23,14 @@ export const constructBoardPermissions = (board: BoardPermissionsProps, session:
|
||||
const creatorId = "creator" in board ? board.creator?.id : board.creatorId;
|
||||
|
||||
return {
|
||||
hasFullAccess: session?.user?.id === creatorId || session?.user.permissions.includes("board-full-access"),
|
||||
hasFullAccess: session?.user.id === creatorId || session?.user.permissions.includes("board-full-access"),
|
||||
hasChangeAccess:
|
||||
session?.user?.id === creatorId ||
|
||||
session?.user.id === creatorId ||
|
||||
board.userPermissions.some(({ permission }) => permission === "board-change") ||
|
||||
board.groupPermissions.some(({ permission }) => permission === "board-change") ||
|
||||
session?.user.permissions.includes("board-modify-all"),
|
||||
hasViewAccess:
|
||||
session?.user?.id === creatorId ||
|
||||
session?.user.id === creatorId ||
|
||||
board.userPermissions.length >= 1 ||
|
||||
board.groupPermissions.length >= 1 ||
|
||||
board.isPublic ||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
import type { ResponseCookie } from "next/dist/compiled/@edge-runtime/cookies";
|
||||
import type { ReadonlyRequestCookies } from "next/dist/server/web/spec-extension/adapters/request-cookies";
|
||||
import { cookies } from "next/headers";
|
||||
import type { Adapter, AdapterUser } from "@auth/core/adapters";
|
||||
import type { Account, User } from "next-auth";
|
||||
import type { Account } from "next-auth";
|
||||
import type { JWT } from "next-auth/jwt";
|
||||
import { describe, expect, it, test, vi } from "vitest";
|
||||
|
||||
@@ -141,21 +142,11 @@ describe("createSignInCallback", () => {
|
||||
expect(result).toBe(true);
|
||||
});
|
||||
|
||||
it("should return true if no user", async () => {
|
||||
const isCredentialsRequest = true;
|
||||
const signInCallback = createSignInCallback(createAdapter(), isCredentialsRequest);
|
||||
const result = await signInCallback({
|
||||
user: undefined as unknown as User,
|
||||
account: {} as Account,
|
||||
});
|
||||
expect(result).toBe(true);
|
||||
});
|
||||
|
||||
it("should return false if no adapter.createSession", async () => {
|
||||
const isCredentialsRequest = true;
|
||||
const signInCallback = createSignInCallback(
|
||||
// https://github.com/nextauthjs/next-auth/issues/6106
|
||||
undefined as unknown as Adapter,
|
||||
{ createSession: undefined } as unknown as Adapter,
|
||||
isCredentialsRequest,
|
||||
);
|
||||
const result = await signInCallback({
|
||||
|
||||
4
packages/common/eslint.config.js
Normal file
4
packages/common/eslint.config.js
Normal file
@@ -0,0 +1,4 @@
|
||||
import baseConfig from "@homarr/eslint-config/base";
|
||||
|
||||
/** @type {import('typescript-eslint').Config} */
|
||||
export default [...baseConfig];
|
||||
@@ -17,7 +17,7 @@
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"clean": "rm -rf .turbo node_modules",
|
||||
"lint": "eslint .",
|
||||
"lint": "eslint",
|
||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
@@ -25,13 +25,8 @@
|
||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint": "^9.4.0",
|
||||
"typescript": "^5.4.5"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": [
|
||||
"@homarr/eslint-config/base"
|
||||
]
|
||||
},
|
||||
"prettier": "@homarr/prettier-config"
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
import * as dotenv from "dotenv";
|
||||
import type { Config } from "drizzle-kit";
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ dotenv.config({ path: "../../.env" });
|
||||
export default {
|
||||
dialect: "sqlite",
|
||||
schema: "./schema",
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
dbCredentials: { url: process.env.DB_URL! },
|
||||
out: "./migrations/sqlite",
|
||||
} satisfies Config;
|
||||
|
||||
@@ -13,6 +13,7 @@ import * as sqliteSchema from "./schema/sqlite";
|
||||
type HomarrDatabase = BetterSQLite3Database<typeof sqliteSchema>;
|
||||
|
||||
const init = () => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||
if (!connection) {
|
||||
switch (process.env.DB_DRIVER) {
|
||||
case "mysql2":
|
||||
@@ -48,6 +49,7 @@ const initMySQL2 = () => {
|
||||
} else {
|
||||
connection = mysql.createConnection({
|
||||
host: process.env.DB_HOST,
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
database: process.env.DB_NAME!,
|
||||
port: Number(process.env.DB_PORT),
|
||||
user: process.env.DB_USER,
|
||||
|
||||
4
packages/db/eslint.config.js
Normal file
4
packages/db/eslint.config.js
Normal file
@@ -0,0 +1,4 @@
|
||||
import baseConfig from "@homarr/eslint-config/base";
|
||||
|
||||
/** @type {import('typescript-eslint').Config} */
|
||||
export default [...baseConfig];
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
import { drizzle } from "drizzle-orm/mysql2";
|
||||
import { migrate } from "drizzle-orm/mysql2/migrator";
|
||||
import mysql from "mysql2";
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
"build:sqlite": "esbuild migrations/sqlite/migrate.ts --bundle --platform=node --outfile=migrations/sqlite/migrate.cjs",
|
||||
"build:mysql": "esbuild migrations/mysql/migrate.ts --bundle --platform=node --outfile=migrations/mysql/migrate.cjs",
|
||||
"clean": "rm -rf .turbo node_modules",
|
||||
"lint": "eslint .",
|
||||
"lint": "eslint",
|
||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
||||
"migration:sqlite:generate": "drizzle-kit generate --config ./configs/sqlite.config.ts",
|
||||
"migration:sqlite:run": "drizzle-kit migrate --config ./configs/sqlite.config.ts",
|
||||
@@ -44,15 +44,9 @@
|
||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||
"@types/better-sqlite3": "7.6.10",
|
||||
"dotenv-cli": "^7.4.2",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint": "^9.4.0",
|
||||
"prettier": "^3.3.1",
|
||||
"typescript": "^5.4.5"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"root": true,
|
||||
"extends": [
|
||||
"@homarr/eslint-config/base"
|
||||
]
|
||||
},
|
||||
"prettier": "@homarr/prettier-config"
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
import type { Column, InferSelectModel } from "drizzle-orm";
|
||||
import type { ForeignKey as MysqlForeignKey, MySqlTableWithColumns } from "drizzle-orm/mysql-core";
|
||||
import type { ForeignKey as SqliteForeignKey, SQLiteTableWithColumns } from "drizzle-orm/sqlite-core";
|
||||
|
||||
4
packages/definitions/eslint.config.js
Normal file
4
packages/definitions/eslint.config.js
Normal file
@@ -0,0 +1,4 @@
|
||||
import baseConfig from "@homarr/eslint-config/base";
|
||||
|
||||
/** @type {import('typescript-eslint').Config} */
|
||||
export default [...baseConfig];
|
||||
@@ -16,7 +16,7 @@
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"clean": "rm -rf .turbo node_modules",
|
||||
"lint": "eslint .",
|
||||
"lint": "eslint",
|
||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
@@ -24,14 +24,9 @@
|
||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint": "^9.4.0",
|
||||
"typescript": "^5.4.5"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": [
|
||||
"@homarr/eslint-config/base"
|
||||
]
|
||||
},
|
||||
"prettier": "@homarr/prettier-config",
|
||||
"dependencies": {
|
||||
"@homarr/common": "workspace:^0.1.0"
|
||||
|
||||
@@ -115,16 +115,16 @@ export const integrationDefs = {
|
||||
}
|
||||
>;
|
||||
|
||||
export const getIconUrl = (integration: IntegrationKind) => integrationDefs[integration]?.iconUrl ?? null;
|
||||
export const getIconUrl = (integration: IntegrationKind) => integrationDefs[integration].iconUrl;
|
||||
|
||||
export const getIntegrationName = (integration: IntegrationKind) => integrationDefs[integration].name;
|
||||
|
||||
export const getDefaultSecretKinds = (integration: IntegrationKind): IntegrationSecretKind[] =>
|
||||
integrationDefs[integration]?.secretKinds[0];
|
||||
integrationDefs[integration].secretKinds[0];
|
||||
|
||||
export const getAllSecretKindOptions = (
|
||||
integration: IntegrationKind,
|
||||
): [IntegrationSecretKind[], ...IntegrationSecretKind[][]] => integrationDefs[integration]?.secretKinds;
|
||||
): [IntegrationSecretKind[], ...IntegrationSecretKind[][]] => integrationDefs[integration].secretKinds;
|
||||
|
||||
export const integrationKinds = objectKeys(integrationDefs);
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ export const getPermissionsWithParents = (permissions: GroupPermissionKey[]): Gr
|
||||
const getPermissionsInner = (permissionSet: Set<GroupPermissionKey>, permissions: GroupPermissionKey[]) => {
|
||||
permissions.forEach((permission) => {
|
||||
const children = groupPermissionParents[permission as keyof typeof groupPermissionParents];
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||
if (children) {
|
||||
getPermissionsInner(permissionSet, children);
|
||||
}
|
||||
|
||||
4
packages/form/eslint.config.js
Normal file
4
packages/form/eslint.config.js
Normal file
@@ -0,0 +1,4 @@
|
||||
import baseConfig from "@homarr/eslint-config/base";
|
||||
|
||||
/** @type {import('typescript-eslint').Config} */
|
||||
export default [...baseConfig];
|
||||
@@ -2,6 +2,7 @@
|
||||
"name": "@homarr/form",
|
||||
"private": true,
|
||||
"version": "0.1.0",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": "./index.ts"
|
||||
},
|
||||
@@ -15,7 +16,7 @@
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"clean": "rm -rf .turbo node_modules",
|
||||
"lint": "eslint .",
|
||||
"lint": "eslint",
|
||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
@@ -23,14 +24,9 @@
|
||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint": "^9.4.0",
|
||||
"typescript": "^5.4.5"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": [
|
||||
"@homarr/eslint-config/base"
|
||||
]
|
||||
},
|
||||
"prettier": "@homarr/prettier-config",
|
||||
"dependencies": {
|
||||
"@mantine/form": "^7.10.1",
|
||||
|
||||
4
packages/icons/eslint.config.js
Normal file
4
packages/icons/eslint.config.js
Normal file
@@ -0,0 +1,4 @@
|
||||
import baseConfig from "@homarr/eslint-config/base";
|
||||
|
||||
/** @type {import('typescript-eslint').Config} */
|
||||
export default [...baseConfig];
|
||||
@@ -16,7 +16,7 @@
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"clean": "rm -rf .turbo node_modules",
|
||||
"lint": "eslint .",
|
||||
"lint": "eslint",
|
||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
@@ -27,13 +27,8 @@
|
||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint": "^9.4.0",
|
||||
"typescript": "^5.4.5"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": [
|
||||
"@homarr/eslint-config/base"
|
||||
]
|
||||
},
|
||||
"prettier": "@homarr/prettier-config"
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ export class GitHubIconRepository extends IconRepository {
|
||||
const fileNameWithExtension = this.getFileNameWithoutExtensionFromPath(treeItem.path);
|
||||
|
||||
return {
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
imageUrl: new URL(this.repositoryBlobUrlTemplate!.replace("{0}", treeItem.path)),
|
||||
fileNameWithExtension: fileNameWithExtension,
|
||||
local: false,
|
||||
|
||||
4
packages/integrations/eslint.config.js
Normal file
4
packages/integrations/eslint.config.js
Normal file
@@ -0,0 +1,4 @@
|
||||
import baseConfig from "@homarr/eslint-config/base";
|
||||
|
||||
/** @type {import('typescript-eslint').Config} */
|
||||
export default [...baseConfig];
|
||||
@@ -17,7 +17,7 @@
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"clean": "rm -rf .turbo node_modules",
|
||||
"lint": "eslint .",
|
||||
"lint": "eslint",
|
||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
@@ -25,17 +25,12 @@
|
||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint": "^9.4.0",
|
||||
"typescript": "^5.4.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"@homarr/definitions": "workspace:^0.1.0",
|
||||
"@homarr/validation": "workspace:^0.1.0"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": [
|
||||
"@homarr/eslint-config/base"
|
||||
]
|
||||
},
|
||||
"prettier": "@homarr/prettier-config"
|
||||
}
|
||||
|
||||
4
packages/log/eslint.config.js
Normal file
4
packages/log/eslint.config.js
Normal file
@@ -0,0 +1,4 @@
|
||||
import baseConfig from "@homarr/eslint-config/base";
|
||||
|
||||
/** @type {import('typescript-eslint').Config} */
|
||||
export default [...baseConfig];
|
||||
@@ -2,6 +2,7 @@
|
||||
"name": "@homarr/log",
|
||||
"private": true,
|
||||
"version": "0.1.0",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./src/index.d.ts",
|
||||
@@ -19,7 +20,7 @@
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"clean": "rm -rf .turbo node_modules",
|
||||
"lint": "eslint .",
|
||||
"lint": "eslint",
|
||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
@@ -32,13 +33,8 @@
|
||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint": "^9.4.0",
|
||||
"typescript": "^5.4.5"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": [
|
||||
"@homarr/eslint-config/base"
|
||||
]
|
||||
},
|
||||
"prettier": "@homarr/prettier-config"
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
void (async () => {
|
||||
const { logger } = await import("./index.mjs");
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-var-requires
|
||||
const nextLogger = require("next/dist/build/output/log");
|
||||
|
||||
const getWinstonMethodForConsole = (consoleMethod) => {
|
||||
@@ -37,9 +36,7 @@ void (async () => {
|
||||
}
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access
|
||||
Object.keys(nextLogger.prefixes).forEach((method) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
nextLogger[method] = getWinstonMethodForNext(method);
|
||||
});
|
||||
})();
|
||||
|
||||
5
packages/modals/eslint.config.js
Normal file
5
packages/modals/eslint.config.js
Normal file
@@ -0,0 +1,5 @@
|
||||
import baseConfig from "@homarr/eslint-config/base";
|
||||
import reactConfig from "@homarr/eslint-config/react";
|
||||
|
||||
/** @type {import('typescript-eslint').Config} */
|
||||
export default [...baseConfig, ...reactConfig];
|
||||
@@ -2,6 +2,7 @@
|
||||
"name": "@homarr/modals",
|
||||
"private": true,
|
||||
"version": "0.1.0",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": "./index.ts"
|
||||
},
|
||||
@@ -15,7 +16,7 @@
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"clean": "rm -rf .turbo node_modules",
|
||||
"lint": "eslint .",
|
||||
"lint": "eslint",
|
||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
@@ -27,13 +28,8 @@
|
||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint": "^9.4.0",
|
||||
"typescript": "^5.4.5"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": [
|
||||
"@homarr/eslint-config/base"
|
||||
]
|
||||
},
|
||||
"prettier": "@homarr/prettier-config"
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ export const ConfirmModal = createModal<Omit<ConfirmModalProps, "title">>(({ act
|
||||
|
||||
const handleCancel = useCallback(
|
||||
async (event: React.MouseEvent<HTMLButtonElement>) => {
|
||||
typeof cancelProps?.onClick === "function" && cancelProps?.onClick(event);
|
||||
typeof cancelProps?.onClick === "function" && cancelProps.onClick(event);
|
||||
typeof onCancel === "function" && (await onCancel());
|
||||
closeOnCancel && actions.closeModal();
|
||||
},
|
||||
@@ -51,7 +51,7 @@ export const ConfirmModal = createModal<Omit<ConfirmModalProps, "title">>(({ act
|
||||
const handleConfirm = useCallback(
|
||||
async (event: React.MouseEvent<HTMLButtonElement>) => {
|
||||
setLoading(true);
|
||||
typeof confirmProps?.onClick === "function" && confirmProps?.onClick(event);
|
||||
typeof confirmProps?.onClick === "function" && confirmProps.onClick(event);
|
||||
typeof onConfirm === "function" && (await onConfirm());
|
||||
closeOnConfirm && actions.closeModal();
|
||||
setLoading(false);
|
||||
@@ -65,11 +65,11 @@ export const ConfirmModal = createModal<Omit<ConfirmModalProps, "title">>(({ act
|
||||
|
||||
<Group justify="flex-end" {...groupProps}>
|
||||
<Button variant="default" {...cancelProps} onClick={handleCancel}>
|
||||
{cancelProps?.children || translateIfNecessary(t, cancelLabel)}
|
||||
{cancelProps?.children ?? translateIfNecessary(t, cancelLabel)}
|
||||
</Button>
|
||||
|
||||
<Button {...confirmProps} onClick={handleConfirm} color="red.9" loading={loading}>
|
||||
{confirmProps?.children || translateIfNecessary(t, confirmLabel)}
|
||||
{confirmProps?.children ?? translateIfNecessary(t, confirmLabel)}
|
||||
</Button>
|
||||
</Group>
|
||||
</>
|
||||
|
||||
@@ -138,6 +138,8 @@ export const useModalAction = <TModal extends ModalDefinition>(modal: TModal) =>
|
||||
|
||||
return {
|
||||
openModal: (innerProps: inferInnerProps<TModal>, options: OpenModalOptions | void) => {
|
||||
// void actually is undefined
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||
context.openModalInner({ modal, innerProps, options: options ?? {} });
|
||||
},
|
||||
};
|
||||
|
||||
@@ -62,7 +62,7 @@ export const modalReducer = (state: ModalsState, action: OpenAction | CloseActio
|
||||
const remainingModals = state.modals.filter((modal) => modal.id !== action.modalId);
|
||||
|
||||
return {
|
||||
current: remainingModals[remainingModals.length - 1] || state.current,
|
||||
current: remainingModals[remainingModals.length - 1] ?? state.current,
|
||||
modals: remainingModals,
|
||||
};
|
||||
}
|
||||
|
||||
4
packages/notifications/eslint.config.js
Normal file
4
packages/notifications/eslint.config.js
Normal file
@@ -0,0 +1,4 @@
|
||||
import baseConfig from "@homarr/eslint-config/base";
|
||||
|
||||
/** @type {import('typescript-eslint').Config} */
|
||||
export default [...baseConfig];
|
||||
@@ -2,6 +2,7 @@
|
||||
"name": "@homarr/notifications",
|
||||
"private": true,
|
||||
"version": "0.1.0",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": "./index.ts",
|
||||
"./styles.css": "./src/styles.css"
|
||||
@@ -16,7 +17,7 @@
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"clean": "rm -rf .turbo node_modules",
|
||||
"lint": "eslint .",
|
||||
"lint": "eslint",
|
||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
@@ -24,17 +25,12 @@
|
||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint": "^9.4.0",
|
||||
"typescript": "^5.4.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"@mantine/notifications": "^7.10.1",
|
||||
"@homarr/ui": "workspace:^0.1.0"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": [
|
||||
"@homarr/eslint-config/base"
|
||||
]
|
||||
},
|
||||
"prettier": "@homarr/prettier-config"
|
||||
}
|
||||
|
||||
4
packages/ping/eslint.config.js
Normal file
4
packages/ping/eslint.config.js
Normal file
@@ -0,0 +1,4 @@
|
||||
import baseConfig from "@homarr/eslint-config/base";
|
||||
|
||||
/** @type {import('typescript-eslint').Config} */
|
||||
export default [...baseConfig];
|
||||
@@ -16,7 +16,7 @@
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"clean": "rm -rf .turbo node_modules",
|
||||
"lint": "eslint .",
|
||||
"lint": "eslint",
|
||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
@@ -28,13 +28,8 @@
|
||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint": "^9.4.0",
|
||||
"typescript": "^5.4.5"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": [
|
||||
"@homarr/eslint-config/base"
|
||||
]
|
||||
},
|
||||
"prettier": "@homarr/prettier-config"
|
||||
}
|
||||
|
||||
4
packages/redis/eslint.config.js
Normal file
4
packages/redis/eslint.config.js
Normal file
@@ -0,0 +1,4 @@
|
||||
import baseConfig from "@homarr/eslint-config/base";
|
||||
|
||||
/** @type {import('typescript-eslint').Config} */
|
||||
export default [...baseConfig];
|
||||
@@ -16,7 +16,7 @@
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"clean": "rm -rf .turbo node_modules",
|
||||
"lint": "eslint .",
|
||||
"lint": "eslint",
|
||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
@@ -30,13 +30,8 @@
|
||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint": "^9.4.0",
|
||||
"typescript": "^5.4.5"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": [
|
||||
"@homarr/eslint-config/base"
|
||||
]
|
||||
},
|
||||
"prettier": "@homarr/prettier-config"
|
||||
}
|
||||
|
||||
4
packages/server-settings/eslint.config.js
Normal file
4
packages/server-settings/eslint.config.js
Normal file
@@ -0,0 +1,4 @@
|
||||
import baseConfig from "@homarr/eslint-config/base";
|
||||
|
||||
/** @type {import('typescript-eslint').Config} */
|
||||
export default [...baseConfig];
|
||||
@@ -16,7 +16,7 @@
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"clean": "rm -rf .turbo node_modules",
|
||||
"lint": "eslint .",
|
||||
"lint": "eslint",
|
||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
@@ -24,13 +24,8 @@
|
||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint": "^9.4.0",
|
||||
"typescript": "^5.4.5"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": [
|
||||
"@homarr/eslint-config/base"
|
||||
]
|
||||
},
|
||||
"prettier": "@homarr/prettier-config"
|
||||
}
|
||||
|
||||
5
packages/spotlight/eslint.config.js
Normal file
5
packages/spotlight/eslint.config.js
Normal file
@@ -0,0 +1,5 @@
|
||||
import baseConfig from "@homarr/eslint-config/base";
|
||||
import reactConfig from "@homarr/eslint-config/react";
|
||||
|
||||
/** @type {import('typescript-eslint').Config} */
|
||||
export default [...baseConfig, ...reactConfig];
|
||||
@@ -2,6 +2,7 @@
|
||||
"name": "@homarr/spotlight",
|
||||
"private": true,
|
||||
"version": "0.1.0",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": "./index.ts",
|
||||
"./styles.css": "./src/styles.css"
|
||||
@@ -16,7 +17,7 @@
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"clean": "rm -rf .turbo node_modules",
|
||||
"lint": "eslint .",
|
||||
"lint": "eslint",
|
||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
@@ -24,14 +25,9 @@
|
||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint": "^9.4.0",
|
||||
"typescript": "^5.4.5"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": [
|
||||
"@homarr/eslint-config/base"
|
||||
]
|
||||
},
|
||||
"prettier": "@homarr/prettier-config",
|
||||
"dependencies": {
|
||||
"@mantine/spotlight": "^7.10.1",
|
||||
|
||||
4
packages/translation/eslint.config.js
Normal file
4
packages/translation/eslint.config.js
Normal file
@@ -0,0 +1,4 @@
|
||||
import baseConfig from "@homarr/eslint-config/base";
|
||||
|
||||
/** @type {import('typescript-eslint').Config} */
|
||||
export default [...baseConfig];
|
||||
@@ -2,6 +2,7 @@
|
||||
"name": "@homarr/translation",
|
||||
"private": true,
|
||||
"version": "0.1.0",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": "./index.ts",
|
||||
"./client": "./src/client.ts",
|
||||
@@ -18,7 +19,7 @@
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"clean": "rm -rf .turbo node_modules",
|
||||
"lint": "eslint .",
|
||||
"lint": "eslint",
|
||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
@@ -26,14 +27,9 @@
|
||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint": "^9.4.0",
|
||||
"typescript": "^5.4.5"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": [
|
||||
"@homarr/eslint-config/base"
|
||||
]
|
||||
},
|
||||
"prettier": "@homarr/prettier-config",
|
||||
"dependencies": {
|
||||
"next-international": "^1.2.4"
|
||||
|
||||
5
packages/ui/eslint.config.js
Normal file
5
packages/ui/eslint.config.js
Normal file
@@ -0,0 +1,5 @@
|
||||
import baseConfig from "@homarr/eslint-config/base";
|
||||
import reactConfig from "@homarr/eslint-config/react";
|
||||
|
||||
/** @type {import('typescript-eslint').Config} */
|
||||
export default [...baseConfig, ...reactConfig];
|
||||
@@ -2,6 +2,7 @@
|
||||
"name": "@homarr/ui",
|
||||
"private": true,
|
||||
"version": "0.1.0",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": "./index.ts",
|
||||
"./styles.css": "./src/styles.css"
|
||||
@@ -16,7 +17,7 @@
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"clean": "rm -rf .turbo node_modules",
|
||||
"lint": "eslint .",
|
||||
"lint": "eslint",
|
||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
@@ -25,17 +26,12 @@
|
||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||
"@types/css-modules": "^1.0.5",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint": "^9.4.0",
|
||||
"typescript": "^5.4.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"@homarr/log": "workspace:^0.1.0",
|
||||
"@homarr/translation": "workspace:^0.1.0"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": [
|
||||
"@homarr/eslint-config/base"
|
||||
]
|
||||
},
|
||||
"prettier": "@homarr/prettier-config"
|
||||
}
|
||||
|
||||
@@ -72,6 +72,7 @@ export const TextMultiSelect = ({ label, value = [], onChange, onBlur, onFocus,
|
||||
onKeyDown={(event) => {
|
||||
if (event.key === "Backspace" && search.length === 0) {
|
||||
event.preventDefault();
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
handleValueRemove(value.at(-1)!);
|
||||
}
|
||||
}}
|
||||
|
||||
4
packages/validation/eslint.config.js
Normal file
4
packages/validation/eslint.config.js
Normal file
@@ -0,0 +1,4 @@
|
||||
import baseConfig from "@homarr/eslint-config/base";
|
||||
|
||||
/** @type {import('typescript-eslint').Config} */
|
||||
export default [...baseConfig];
|
||||
@@ -17,7 +17,7 @@
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"clean": "rm -rf .turbo node_modules",
|
||||
"lint": "eslint .",
|
||||
"lint": "eslint",
|
||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
@@ -25,14 +25,9 @@
|
||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint": "^9.4.0",
|
||||
"typescript": "^5.4.5"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": [
|
||||
"@homarr/eslint-config/base"
|
||||
]
|
||||
},
|
||||
"prettier": "@homarr/prettier-config",
|
||||
"dependencies": {
|
||||
"zod": "^3.23.8",
|
||||
|
||||
@@ -3,7 +3,9 @@ import { z } from "zod";
|
||||
type CouldBeReadonlyArray<T> = T[] | readonly T[];
|
||||
|
||||
export const zodEnumFromArray = <T extends string>(array: CouldBeReadonlyArray<T>) =>
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
z.enum([array[0]!, ...array.slice(1)]);
|
||||
|
||||
export const zodUnionFromArray = <T extends z.ZodTypeAny>(array: CouldBeReadonlyArray<T>) =>
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
z.union([array[0]!, array[1]!, ...array.slice(2)]);
|
||||
|
||||
@@ -13,7 +13,7 @@ export const zodErrorMap = <
|
||||
const error = handleZodError(issue, ctx);
|
||||
if ("message" in error && error.message)
|
||||
return {
|
||||
message: error.message ?? ctx.defaultError,
|
||||
message: error.message,
|
||||
};
|
||||
return {
|
||||
message: t(error.key ? `common.zod.${error.key}` : "common.zod.errors.default", error.params ?? {}),
|
||||
|
||||
5
packages/widgets/eslint.config.js
Normal file
5
packages/widgets/eslint.config.js
Normal file
@@ -0,0 +1,5 @@
|
||||
import baseConfig from "@homarr/eslint-config/base";
|
||||
import reactConfig from "@homarr/eslint-config/react";
|
||||
|
||||
/** @type {import('typescript-eslint').Config} */
|
||||
export default [...baseConfig, ...reactConfig];
|
||||
@@ -2,6 +2,7 @@
|
||||
"name": "@homarr/widgets",
|
||||
"private": true,
|
||||
"version": "0.1.0",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": "./index.ts",
|
||||
"./errors": "./src/errors/component.tsx"
|
||||
@@ -16,7 +17,7 @@
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"clean": "rm -rf .turbo node_modules",
|
||||
"lint": "eslint .",
|
||||
"lint": "eslint",
|
||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
@@ -26,14 +27,9 @@
|
||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||
"@types/prismjs": "^1.26.4",
|
||||
"@types/video.js": "^7.3.58",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint": "^9.4.0",
|
||||
"typescript": "^5.4.5"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": [
|
||||
"@homarr/eslint-config/base"
|
||||
]
|
||||
},
|
||||
"prettier": "@homarr/prettier-config",
|
||||
"dependencies": {
|
||||
"@homarr/api": "workspace:^0.1.0",
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user