Skip to content
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

Merged
merged 6 commits into from
Aug 21, 2024
Merged

chore: replace eslint/prettier with biome #1131

merged 6 commits into from
Aug 21, 2024

Conversation

BugGambit
Copy link
Contributor

@BugGambit BugGambit commented Aug 19, 2024

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

Comment on lines +230 to +259
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();
Copy link
Contributor Author

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.

@BugGambit BugGambit marked this pull request as ready for review August 19, 2024 21:11
@BugGambit BugGambit requested review from andersfylling and a team as code owners August 19, 2024 21:11
Copy link
Contributor

@danlevings danlevings left a 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!

@BugGambit BugGambit enabled auto-merge (squash) August 21, 2024 09:42
@BugGambit BugGambit merged commit e6ce854 into master Aug 21, 2024
9 checks passed
@BugGambit BugGambit deleted the f1/biome branch August 21, 2024 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants