-
-
Notifications
You must be signed in to change notification settings - Fork 721
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
Biome1.5.1 #5867
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
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.
Wow.
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.
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; |
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.
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: '', |
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.
I guess default channels should be allowed to be undefined... maybe the type definition is wrong?
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.
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> |
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.
This is prod code, maybe we can add an explanation, or just don't know why this is ignored rather than
environment: '', | ||
projects: [], | ||
tokenName: '', |
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.
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
@@ -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( |
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.
getApplication and get methods are the same, should we remove one of them?
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.
getApplication doesn't exist on the store interface. it was written only on the fake store, but yes, we could remove it.
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.
unleash/src/lib/db/client-applications-store.ts
Lines 157 to 169 in e27a578
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); | |
} |
Co-authored-by: Gastón Fournier <[email protected]>
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 inbeforeAll
.