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
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 ?? {}),
|
||||
|
||||
Reference in New Issue
Block a user