Skip to content

Commit 2afa8c7

Browse files
chore(deps): upgrade to biome v2 (#87)
1 parent b290cb3 commit 2afa8c7

File tree

13 files changed

+66
-71
lines changed

13 files changed

+66
-71
lines changed

biome.json

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.2.7/schema.json",
33
"files": {
4-
"include": ["./**/*.js", "./**/*.ts"],
5-
"ignore": [
6-
"**/node_modules",
7-
"**/dist",
8-
"**/build",
9-
"**/coverage",
10-
"**/lib",
11-
"**/.wrangler"
4+
"includes": [
5+
"**/*.js",
6+
"**/*.ts",
7+
"!**/node_modules",
8+
"!**/dist",
9+
"!**/build",
10+
"!**/coverage",
11+
"!**/lib",
12+
"!**/.wrangler"
1213
]
1314
},
14-
"organizeImports": {
15-
"enabled": true
16-
},
15+
"assist": { "actions": { "source": { "organizeImports": "on" } } },
1716
"linter": {
1817
"enabled": true,
1918
"rules": {

discord-activity-starter/packages/server/src/app.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import express, {
66
type Response,
77
} from 'express';
88
import { fetchAndRetry } from './utils';
9+
910
dotenv.config({ path: '../../.env' });
1011

1112
const app: Application = express();

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
"lint": "biome check ."
1515
},
1616
"devDependencies": {
17-
"@biomejs/biome": "^1.8.3"
17+
"@biomejs/biome": "^2.2.7"
1818
}
1919
}

pnpm-lock.yaml

Lines changed: 37 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk-playground/packages/client/functions/_middleware.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { verifyProxyAuth } from 'shared';
21
import type { Env } from 'shared';
2+
import { verifyProxyAuth } from 'shared';
33
import { AUTH_REQUIRED_HTML, SERVER_ERROR_HTML } from './templates';
44

55
type AuthMode = 'enforce' | 'log-only' | 'disabled';
@@ -24,7 +24,7 @@ function getAuthMode(request: Request, env: Env): AuthMode {
2424
return 'log-only';
2525
}
2626

27-
function shouldSkipAuth(request: Request, env: Env): boolean {
27+
function shouldSkipAuth(request: Request, _env: Env): boolean {
2828
const url = new URL(request.url);
2929

3030
if (url.hostname === 'localhost' || url.hostname === '127.0.0.1') {

sdk-playground/packages/client/src/DiscordAPI.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ export enum RequestType {
1111
export interface DiscordAPIRequest {
1212
endpoint: string;
1313
method: RequestType;
14-
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
15-
body?: any;
14+
body?: unknown;
1615
headers?: Record<string, string>;
1716
stringifyBody?: boolean;
1817
}
@@ -34,7 +33,7 @@ function request<T>(
3433
return fetch(`${Constants.urls.discord}${endpoint}`, {
3534
method,
3635
headers,
37-
body: stringifyBody === true ? JSON.stringify(body) : body,
36+
body: stringifyBody === true ? JSON.stringify(body) : (body as BodyInit),
3837
})
3938
.then((response) => {
4039
if (!response.ok || response.status >= 400) {

sdk-playground/packages/client/vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default defineConfig(({ mode }) => {
88
plugins: [react()],
99
envDir: '../../',
1010
server: {
11-
port: Number.parseInt(env.WEBAPP_SERVE_PORT),
11+
port: Number.parseInt(env.WEBAPP_SERVE_PORT, 10),
1212
allowedHosts: true,
1313
proxy: {
1414
'/api': {

sdk-playground/packages/server/src/handleApiRequest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export function handleApiRequest(path: string[], request: Request, env: Env) {
88
// We've received at API request. Route the request based on the path.
99
switch (path[0]) {
1010
case 'token':
11-
return tokenHandler(path, request, env);
11+
return tokenHandler(request, env);
1212
case 'iap':
1313
return iapHandler(path, request, env);
1414
case 'activity-instance':

sdk-playground/packages/server/src/handlers/getActivityInstanceHandler.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { readRequestBody, requestHeaders } from '../lib/request';
2-
import type { Env, IGetOAuthToken } from '../types';
1+
import { requestHeaders } from '../lib/request';
2+
import type { Env } from '../types';
33

44
export default async function getActivityInstanceHandler(
55
path: string[],
6-
request: Request,
6+
_request: Request,
77
env: Env,
88
) {
99
try {

sdk-playground/packages/server/src/handlers/iapHandler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ async function getSkus(applicationId: string, env: Env): Promise<IGetSKUs[]> {
2525
});
2626
}
2727

28-
async function getSkusHandler(path: string[], request: Request, env: Env) {
28+
async function getSkusHandler(path: string[], _request: Request, env: Env) {
2929
const applicationId = path[1];
3030
try {
3131
const skus = await getSkus(applicationId, env);
@@ -71,7 +71,7 @@ async function getEntitlements(path: string[], request: Request, env: Env) {
7171
}
7272
}
7373

74-
async function postConsume(path: string[], request: Request, env: Env) {
74+
async function postConsume(path: string[], _request: Request, env: Env) {
7575
const applicationId = path[1];
7676
const entitlementId = path[3];
7777
try {

0 commit comments

Comments
 (0)