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

Biome1.5.1 #5867

Merged
merged 4 commits into from
Jan 12, 2024
Merged

Biome1.5.1 #5867

merged 4 commits into from
Jan 12, 2024

Conversation

chriswk
Copy link
Member

@chriswk chriswk commented Jan 11, 2024

Lots of work here, mostly because I didn't want to turn off the noImplicitAnyLet lint. This PR tries its best to type all the untyped lets biome complained about (Don't ask me how many hours that took or how many lints that was >200...), which in the future will force test authors to actually type their global variables setup in beforeAll.

Copy link

vercel bot commented Jan 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 12, 2024 9:04am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Visit Preview Jan 12, 2024 9:04am

Copy link
Member

@nunogois nunogois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow.

Copy link
Contributor

@gastonfournier gastonfournier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Overall I noticed inconsistencies between let variable: X; and let variable: X | undefined but I think it doesn't hurt. Also, a few comments can be notes for later. As long as tests pass I'm ok with this one, it's a great improvement

@@ -26,7 +26,7 @@ jest.mock('@slack/web-api', () => ({
}));

describe('SlackAppAddon', () => {
let addon;
let addon: SlackAppAddon;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the type be | undefined? because you're not assigning it a value on declaration

await addon.handleEvent(eventWith2Tags, { accessToken });
await addon.handleEvent(eventWith2Tags, {
accessToken,
defaultChannels: '',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess default channels should be allowed to be undefined... maybe the type definition is wrong?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also works, since defaultChannels must be truthy for us to treat it as set, and the empty string is falsy.
But yes, future improvement could be to make defaultChannels optional.

@@ -102,6 +102,7 @@ class StateController extends Controller {
const userName = extractUsername(req);
const { drop, keep } = req.query;
// TODO: Should override request type so file is a type on request
// biome-ignore lint/suspicious/noImplicitAnyLet: <explanation>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is prod code, maybe we can add an explanation, or just don't know why this is ignored rather than

Comment on lines +55 to +57
environment: '',
projects: [],
tokenName: '',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is fine, but unsure if this ends up being the same as sending undefined. I trust it because the test fails, but I'm not sure if we're actually testing the output of this insert

src/test/e2e/api/admin/tags.e2e.test.ts Show resolved Hide resolved
@@ -125,15 +132,18 @@ test('Merge keeps value for single row in database', async () => {
appName: clientRegistration.appName,
description: 'new description',
});
const stored = await clientApplicationsStore.getApplication(
const stored = await clientApplicationsStore.get(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getApplication and get methods are the same, should we remove one of them?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getApplication doesn't exist on the store interface. it was written only on the fake store, but yes, we could remove it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

async getApplication(appName: string): Promise<IClientApplication> {
const row = await this.db
.select(COLUMNS)
.where('app_name', appName)
.from(TABLE)
.first();
if (!row) {
throw new NotFoundError(`Could not find appName=${appName}`);
}
return mapRow(row);
}
isn't it this one?

src/test/fixtures/fake-strategies-store.ts Outdated Show resolved Hide resolved
@chriswk chriswk enabled auto-merge (squash) January 12, 2024 09:00
@chriswk chriswk merged commit 5a3bb1f into main Jan 12, 2024
13 checks passed
@chriswk chriswk deleted the biome1.5.1 branch January 12, 2024 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants