-
Notifications
You must be signed in to change notification settings - Fork 676
chore(deps-dev): bump @biomejs/biome to v2 for all packages #2281
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
Changes from 11 commits
961a5a9
9ab66f9
8514f43
639aac9
e6cf5b3
287a1da
8d16d34
9e6e869
2a7a422
c6b420b
7f16dc4
22308ce
fbe3737
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json", | ||
"$schema": "https://biomejs.dev/schemas/2.0.5/schema.json", | ||
"assist": { | ||
"actions": { | ||
"source": { | ||
"organizeImports": "on" | ||
} | ||
} | ||
}, | ||
"formatter": { | ||
"enabled": true, | ||
"formatWithErrors": false, | ||
"ignore": [], | ||
"includes": [ | ||
"**" | ||
], | ||
"attributePosition": "auto", | ||
"indentStyle": "space", | ||
"indentWidth": 2, | ||
|
@@ -18,12 +27,21 @@ | |
"linter": { | ||
"enabled": true, | ||
"rules": { | ||
"recommended": true | ||
"recommended": true, | ||
"style": { | ||
"noParameterAssign": "error", | ||
"useAsConstAssertion": "error", | ||
"useDefaultParameterLast": "error", | ||
"useEnumInitializers": "error", | ||
"useSelfClosingElements": "error", | ||
"useSingleVarDeclarator": "error", | ||
"noUnusedTemplateLiteral": "error", | ||
"useNumberNamespace": "error", | ||
"noInferrableTypes": "error", | ||
"noUselessElse": "error" | ||
} | ||
Comment on lines
+31
to
+42
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. note: These are the defaults that the migration command added. I believe they are meant to represent the default, recommended style rules. |
||
} | ||
}, | ||
"organizeImports": { | ||
"enabled": true | ||
}, | ||
"vcs": { | ||
"enabled": true, | ||
"clientKind": "git", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json", | ||
"$schema": "https://biomejs.dev/schemas/2.0.5/schema.json", | ||
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. note: Each package extends the base |
||
"extends": ["../../biome.json"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,11 @@ | |
"description": "Node implementation of the contract between the Slack CLI and Bolt for JavaScript", | ||
"author": "Slack Technologies, LLC", | ||
"license": "MIT", | ||
"keywords": ["slack", "cli", "hooks"], | ||
"keywords": [ | ||
"cli", | ||
"hooks", | ||
"slack" | ||
], | ||
Comment on lines
+7
to
+11
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. note: biome linter rule requires multiple element arrays to be on newlines. |
||
"type": "module", | ||
"main": "src/get-hooks.js", | ||
"files": [ | ||
|
@@ -51,7 +55,7 @@ | |
"semver": "^7.5.4" | ||
}, | ||
"devDependencies": { | ||
"@biomejs/biome": "^1.8.3", | ||
"@biomejs/biome": "^2.0.5", | ||
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. note: Upgrading the biome npm package to v2. |
||
"@types/minimist": "^1.2.5", | ||
"@types/mocha": "^10.0.6", | ||
"@types/node": "^24.0.3", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,9 +6,9 @@ import { after, before, describe, it } from 'mocha'; | |
import sinon from 'sinon'; | ||
|
||
import checkForSDKUpdates, { | ||
createUpdateErrorMessage, | ||
hasAvailableUpdates, | ||
hasBreakingChange, | ||
Comment on lines
+9
to
11
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. note: Biome linter rule requires the imports to be sorted. |
||
createUpdateErrorMessage, | ||
} from './check-update.js'; | ||
|
||
/** | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ import assert from 'node:assert'; | |
import { afterEach, beforeEach, describe, it } from 'mocha'; | ||
import sinon from 'sinon'; | ||
|
||
import { DefaultProtocol, MessageBoundaryProtocol, getProtocol } from './protocols.js'; | ||
import { DefaultProtocol, getProtocol, MessageBoundaryProtocol } from './protocols.js'; | ||
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. note: Biome linter rule requires the imports to be sorted. |
||
|
||
describe('protocol implementations', () => { | ||
describe('default protocol', () => { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json", | ||
"$schema": "https://biomejs.dev/schemas/2.0.5/schema.json", | ||
"extends": ["../../biome.json"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
import { shell } from './shell'; | ||
|
||
import type { SpawnOptionsWithoutStdio } from 'node:child_process'; | ||
import type { ShellProcess } from '../types/shell'; | ||
import { shell } from './shell'; | ||
|
||
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. note: biome requires the imports to be sorted alphabetically based on their |
||
export interface SlackCLIGlobalOptions { | ||
/** | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json", | ||
"$schema": "https://biomejs.dev/schemas/2.0.5/schema.json", | ||
"extends": ["../../biome.json"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json", | ||
"$schema": "https://biomejs.dev/schemas/2.0.5/schema.json", | ||
"extends": ["../../biome.json"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,37 @@ | ||
export { Logger, LogLevel } from './logger'; | ||
// InstallProvider inputs / outputs | ||
|
||
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. note: This file was a bit of a nightmare because Biome wants the imports to be sorted alphabetically, but the file has sorted the imports logically. To keep the logical ordering, I used Biome's "Chunks", which are comments separated by newlines. Everything inside a chunk is sorted. // Chunk 1
export A
export B
export C
// Chunk 2
export A
export B
export C
// Chunk 3
export A
// Comment about B
export B
export C |
||
// The inputs / outputs of the InstallProvider module | ||
export { AuthorizeResult } from './authorize-result'; | ||
export { Installation, OrgInstallation } from './installation'; | ||
export { InstallationQuery, OrgInstallationQuery } from './installation-query'; | ||
|
||
// The errors that can be returned by this module | ||
export * from './errors'; | ||
// InstallProvider core | ||
|
||
// The core part of this library | ||
export { | ||
InstallProvider, | ||
OAuthV2TokenRefreshResponse, | ||
OAuthV2Response, | ||
OAuthV2TokenRefreshResponse, | ||
} from './install-provider'; | ||
|
||
export { InstallProviderOptions } from './install-provider-options'; | ||
export { InstallURLOptions } from './install-url-options'; | ||
// the callback handlers for the `/slack/install` path | ||
export { InstallPathOptions } from './install-path-options'; | ||
export { default as defaultRenderHtmlForInstallPath } from './default-render-html-for-install-path'; | ||
// the callback handlers for the `/slack/oauth_redirect` path | ||
|
||
// InstallProvider callback handlers | ||
|
||
// Callback handlers for the `/slack/oauth_redirect` path | ||
export { | ||
CallbackOptions, | ||
defaultCallbackFailure, | ||
defaultCallbackSuccess, | ||
} from './callback-options'; | ||
// Callback handlers for the `/slack/install` path | ||
export { default as defaultRenderHtmlForInstallPath } from './default-render-html-for-install-path'; | ||
export { InstallPathOptions } from './install-path-options'; | ||
|
||
// InstallationStore and StateStore interfaces | ||
|
||
// InstallationStore interface and built-in implementations | ||
export * from './installation-stores'; | ||
// StateStore interface and built-in implementations | ||
export * from './state-stores'; | ||
|
||
// Utilities | ||
|
||
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. question: Anyone got a better chunk category name for errors and logger? 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. Half joking, but "errors" and "logger" wouldn't be not descriptive 😉 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. Very good suggestion, actually! Commit 22308ce updates it to "Errors" and "Logging" 🙇🏻 |
||
export * from './errors'; | ||
export { Logger, LogLevel } from './logger'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,23 +31,27 @@ rewiremock(() => require('@slack/web-api')).with({ | |
}, | ||
}); | ||
rewiremock.enable(); | ||
|
||
import { | ||
type CallbackOptions, | ||
type InstallPathOptions, | ||
InstallProvider, | ||
type Installation, | ||
type InstallationStore, | ||
type InstallPathOptions, | ||
InstallProvider, | ||
type StateStore, | ||
} from './index'; | ||
|
||
rewiremock.disable(); | ||
|
||
Comment on lines
+43
to
+45
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. note: Biome requires blank newlines between import/export and functions. |
||
import type { OAuthV2AccessArguments, OauthV2AccessResponse, WebClientOptions } from '@slack/web-api'; | ||
import { | ||
type AuthorizationError, | ||
ErrorCode, | ||
type GenerateInstallUrlError, | ||
type InstallerInitializationError, | ||
} from './errors'; | ||
import { LogLevel, type Logger } from './logger'; | ||
import { type Logger, LogLevel } from './logger'; | ||
|
||
const webClientOptions: WebClientOptions = { timeout: 1000 }; | ||
|
||
async function mockedV2AccessResp(options: OAuthV2AccessArguments): Promise<OauthV2AccessResponse> { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,8 +42,8 @@ const storedInstallation = { | |
isEnterpriseInstall: false, | ||
}; | ||
|
||
// TODO: valid tests with org-wide installations | ||
const storedOrgInstallation = { | ||
// TODO: valid tests with org-wide installations, remove _ prefix when implemented. | ||
const _storedOrgInstallation = { | ||
Comment on lines
+45
to
+46
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. note: Biome requires an |
||
team: null, | ||
enterprise: { | ||
id: 'test-enterprise-id', | ||
|
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: Upgraded to schema v2 by following the v3 Upgrade Gudie and running: