-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: replace eslint/prettier with biome #1131
Conversation
const normalizedParams: Record<string, string> = Object.entries( | ||
params | ||
).reduce( | ||
(acc, [key, value]) => { | ||
switch (typeof value) { | ||
case 'undefined': { | ||
return acc; | ||
} | ||
case 'string': | ||
case 'number': | ||
case 'boolean': { | ||
acc[key] = `${value}`; | ||
return acc; | ||
} | ||
case 'object': { | ||
if (Array.isArray(value)) { | ||
acc[key] = `[${value.join(',')}]`; | ||
} | ||
return acc; | ||
} | ||
default: { | ||
throw new Error( | ||
`Unsupported value query parameter type: ${typeof value}, ${key}: ${value}` | ||
); | ||
} | ||
} | ||
}, | ||
{} as Record<string, string> | ||
); | ||
const search = new URLSearchParams(normalizedParams).toString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Biome was strictier in the type and we had to open up for params
to be type of object. URLSearchParams
can't take in a generic object, so we need to handle each type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems like the only file worth reviewing is the biome.json / package.json file? everything else is either automatic linting or deleting things that arent needed anymore
if so, its not much to review, looks fine to me!
Part of splitting up this PR: #1128
Biome is an efficient linter and formatted.
This PR replaces eslint/prettier with Biome and formats our files accordingly.
Jira: https://cognitedata.atlassian.net/browse/AUTH-3069