Merged in chore/update-eslint-configs (pull request #2812)
chore: Extend eslint configs from @typescript-eslint/recommended * Change to typescript recommended in scandic-web * Remove comment * Change to recommended ts config in partner-sas * Change to recommended ts lint config in booking-flow Approved-by: Linus Flood
This commit is contained in:
@@ -548,6 +548,7 @@ const getSearchParams = (input: string) => {
|
||||
return searchParamsToObject(searchParams)
|
||||
}
|
||||
const searchParamsToObject = (searchParams: URLSearchParams) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const obj: Record<string, any> = {}
|
||||
for (const [key, value] of searchParams.entries()) {
|
||||
obj[key] = value
|
||||
|
||||
@@ -20,6 +20,7 @@ export function parseSearchParams<T extends z.ZodRawShape>(
|
||||
export function parseSearchParams<T extends z.ZodRawShape>(
|
||||
searchParams: NextSearchParams,
|
||||
options?: ParseOptions<T>
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
): Record<string, any>
|
||||
|
||||
/**
|
||||
@@ -49,6 +50,7 @@ export function parseSearchParams<T extends z.ZodRawShape>(
|
||||
|
||||
const buildObject = getBuilder(options || {})
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const resultObject: Record<string, any> = {}
|
||||
for (const [key, value] of entries) {
|
||||
const paths = key.split(".")
|
||||
@@ -80,6 +82,7 @@ function getBuilder<T extends z.ZodRawShape>(options: ParseOptions<T>) {
|
||||
const typeHints = options.typeHints || {}
|
||||
|
||||
return function buildNestedObject(
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
obj: Record<string, any>,
|
||||
paths: string[],
|
||||
value: string
|
||||
@@ -134,6 +137,7 @@ function getBuilder<T extends z.ZodRawShape>(options: ParseOptions<T>) {
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function isNotArray(value: any) {
|
||||
return !value || typeof value !== "object" || !Array.isArray(value)
|
||||
}
|
||||
@@ -157,6 +161,7 @@ type SerializeOptions = {
|
||||
* Arrays are not merged, they will always replace existing values.
|
||||
*/
|
||||
export function serializeSearchParams(
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
obj: Record<string, any>,
|
||||
options?: SerializeOptions
|
||||
): URLSearchParams {
|
||||
|
||||
Reference in New Issue
Block a user