-
Notifications
You must be signed in to change notification settings - Fork 429
chore: update biome configurations and applied settings #2931
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
Merged
zimeg
merged 6 commits into
slackapi:main
from
theorderingmachine:chore/migrate-biome-v2
May 15, 2026
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
3c70230
chore: migrate biome to v2
theorderingmachine 85e42ab
style: expand biome config object
theorderingmachine 9e33816
style: relax unused checks in examples
theorderingmachine 250bcfe
style: keep oauth example req name
theorderingmachine 8486c73
style: combine related imports
theorderingmachine 0ea3a5b
style: combine context imports
theorderingmachine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| import type { Agent } from 'node:http'; | ||
| import type { SecureContextOptions } from 'node:tls'; | ||
| import util from 'node:util'; | ||
| import { ConsoleLogger, LogLevel, type Logger } from '@slack/logger'; | ||
| import { WebClient, type WebClientOptions, addAppMetadata } from '@slack/web-api'; | ||
| import { ConsoleLogger, type Logger, LogLevel } from '@slack/logger'; | ||
| import { addAppMetadata, WebClient, type WebClientOptions } from '@slack/web-api'; | ||
| import axios, { type AxiosInstance } from 'axios'; | ||
| import type { Assistant } from './Assistant'; | ||
| import { | ||
|
|
@@ -11,32 +11,32 @@ import { | |
| type FunctionFailFn, | ||
| type SlackCustomFunctionMiddlewareArgs, | ||
| } from './CustomFunction'; | ||
| import type { WorkflowStep } from './WorkflowStep'; | ||
| import { | ||
| createFunctionComplete, | ||
| createFunctionFail, | ||
| createRespond, | ||
| createSay, | ||
| createSayStream, | ||
| createSetStatus, | ||
| type SayStreamFn, | ||
| type SetStatusFn, | ||
| } from './context'; | ||
| import type { SayStreamFn, SetStatusFn } from './context'; | ||
| import { type ConversationStore, MemoryStore, conversationContext } from './conversation-store'; | ||
| import { type ConversationStore, conversationContext, MemoryStore } from './conversation-store'; | ||
| import { | ||
| AppInitializationError, | ||
| asCodedError, | ||
| type CodedError, | ||
| ErrorCode, | ||
| InvalidCustomPropertyError, | ||
| MultipleListenerError, | ||
| asCodedError, | ||
| } from './errors'; | ||
| import { | ||
| IncomingEventType, | ||
| assertNever, | ||
| extractEventChannelId, | ||
| extractEventThreadTs, | ||
| extractEventTs, | ||
| getTypeAndConversation, | ||
| IncomingEventType, | ||
| isBodyWithTypeEnterpriseInstall, | ||
| isEventTypeToSkipAuthorize, | ||
| } from './helpers'; | ||
|
|
@@ -96,7 +96,9 @@ import type { | |
| WorkflowStepEdit, | ||
| } from './types'; | ||
| import { contextBuiltinKeys } from './types'; | ||
| import { type StringIndexed, isRejected } from './types/utilities'; | ||
| import { isRejected, type StringIndexed } from './types/utilities'; | ||
| import type { WorkflowStep } from './WorkflowStep'; | ||
|
|
||
| const packageJson = require('../package.json'); | ||
|
|
||
| export type { ActionConstraints, OptionsConstraints, ShortcutConstraints, ViewConstraints } from './types'; | ||
|
|
@@ -154,7 +156,7 @@ export interface AppOptions { | |
| attachFunctionToken?: boolean; | ||
| } | ||
|
|
||
| export { LogLevel, Logger } from '@slack/logger'; | ||
| export { Logger, LogLevel } from '@slack/logger'; | ||
|
|
||
| /** Authorization function - seeds the middleware processing and listeners with an authorization context */ | ||
| export type Authorize<IsEnterpriseInstall extends boolean = false> = ( | ||
|
|
@@ -1083,7 +1085,7 @@ export default class App<AppCustomContext extends StringIndexed = StringIndexed> | |
|
|
||
| // TODO: this logic should be isolated and tested according to the expected behavior | ||
| if (token !== undefined) { | ||
| let pool: WebClientPool | undefined = undefined; | ||
| let pool: WebClientPool | undefined; | ||
| const clientOptionsCopy = { ...this.clientOptions }; | ||
| if (authorizeResult.teamId !== undefined) { | ||
| pool = this.clients[authorizeResult.teamId]; | ||
|
|
@@ -1228,7 +1230,6 @@ export default class App<AppCustomContext extends StringIndexed = StringIndexed> | |
| const rejectedListenerResults = settledListenerResults.filter(isRejected); | ||
| if (rejectedListenerResults.length === 1) { | ||
| throw rejectedListenerResults[0].reason; | ||
| // biome-ignore lint/style/noUselessElse: I think this is a biome issue actually... | ||
| } else if (rejectedListenerResults.length > 1) { | ||
| throw new MultipleListenerError(rejectedListenerResults.map((rlr) => rlr.reason)); | ||
| } | ||
|
|
@@ -1355,15 +1356,15 @@ export default class App<AppCustomContext extends StringIndexed = StringIndexed> | |
| throw new AppInitializationError( | ||
| `${tokenUsage} \n\nSince you have not provided a token or authorize, you might be missing one or more required oauth installer options. See https://docs.slack.dev/tools/bolt-js/concepts/authenticating-oauth/ for these required fields.\n`, | ||
| ); | ||
| // biome-ignore lint/style/noUselessElse: I think this is a biome issue actually... | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🌲 praise: Thanks latest update! |
||
| } else if (authorize !== undefined && usingOauth) { | ||
| } | ||
| if (authorize !== undefined && usingOauth) { | ||
| throw new AppInitializationError(`You cannot provide both authorize and oauth installer options. ${tokenUsage}`); | ||
| // biome-ignore lint/style/noUselessElse: I think this is a biome issue actually... | ||
| } else if (authorize === undefined && usingOauth) { | ||
| } | ||
| if (authorize === undefined && usingOauth) { | ||
| // biome-ignore lint/style/noNonNullAssertion: we know installer is truthy here | ||
| return httpReceiver.installer!.authorize; | ||
| // biome-ignore lint/style/noUselessElse: I think this is a biome issue actually... | ||
| } else if (authorize !== undefined && !usingOauth) { | ||
| } | ||
| if (authorize !== undefined && !usingOauth) { | ||
| return authorize as Authorize<boolean>; | ||
| } | ||
| return undefined; | ||
|
|
@@ -1647,9 +1648,9 @@ function escapeHtml(input: string | undefined | null): string { | |
| } | ||
|
|
||
| function extractFunctionContext(body: StringIndexed) { | ||
| let functionExecutionId: string | undefined = undefined; | ||
| let functionBotAccessToken: string | undefined = undefined; | ||
| let functionInputs: FunctionInputs | undefined = undefined; | ||
| let functionExecutionId: string | undefined; | ||
| let functionBotAccessToken: string | undefined; | ||
| let functionInputs: FunctionInputs | undefined; | ||
|
|
||
| // function_executed event | ||
| if (body.event && body.event.type === 'function_executed' && body.event.function_execution_id) { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
📚 note: Our examples use handfuls of unused variables with intention so we ignore some rule for now to avoid more changes:
bolt-js/examples/socket-mode/app.js
Lines 59 to 63 in c8de330