Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/dry-toys-count.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@cloudflare/workers-oauth-provider': patch
---

fix types, add linting
3 changes: 2 additions & 1 deletion __tests__/mocks/cloudflare-workers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* Mock for cloudflare:workers module
* Provides a minimal implementation of WorkerEntrypoint for testing
*/
/** biome-ignore-all lint/suspicious/noExplicitAny: it's fine */

export class WorkerEntrypoint {
ctx: any;
Expand All @@ -12,7 +13,7 @@ export class WorkerEntrypoint {
this.env = env;
}

fetch(request: Request): Response | Promise<Response> {
fetch(_request: Request): Response | Promise<Response> {
throw new Error('Method not implemented. This should be overridden by subclasses.');
}
}
345 changes: 186 additions & 159 deletions __tests__/oauth-provider.test.ts

Large diffs are not rendered by default.

61 changes: 61 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"$schema": "https://biomejs.dev/schemas/2.1.4/schema.json",
"assist": {
"actions": {
"source": {
"useSortedKeys": "off",
"organizeImports": "off"
}
},
"enabled": true
},
"files": {
"ignoreUnknown": false,
"includes": [
"src/**",
"__tests__/**",
".github/**",
"!node_modules",
"!dist",
"!.wrangler",
"!wrangler.jsonc",
"!./tsconfig.json",
"!package.json",
"!package-lock.json"
]
},
"formatter": {
"enabled": false,
"indentStyle": "tab"
},
"linter": {
"enabled": true,
"rules": {
"a11y": {
"useKeyWithClickEvents": "off"
},
"complexity": {
"noBannedTypes": "off"
},
"recommended": true,
"style": {
"noInferrableTypes": "error",
"noNonNullAssertion": "off",
"noParameterAssign": "error",
"noUnusedTemplateLiteral": "error",
"noUselessElse": "off",
"useAsConstAssertion": "error",
"useDefaultParameterLast": "error",
"useEnumInitializers": "error",
"useNumberNamespace": "error",
"useSelfClosingElements": "error",
"useSingleVarDeclarator": "error"
}
}
},
"vcs": {
"clientKind": "git",
"enabled": false,
"useIgnoreFile": false
}
}
Empty file added example/index.html
Empty file.
Empty file added example/src/client.tsx
Empty file.
Empty file added example/src/server.ts
Empty file.
Empty file added example/vite.config.ts
Empty file.
Empty file added example/wrangler.jsonc
Empty file.
164 changes: 164 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
"scripts": {
"build": "tsup",
"build:watch": "tsup --watch",
"check": "npm run typecheck && npm run test",
"typecheck": "tsc",
"check": "biome check && tsc && npm run test",
"test": "vitest run",
"test:watch": "vitest",
"prepublishOnly": "npm run build",
"prettier": "prettier -w ."
},
"devDependencies": {
"@biomejs/biome": "^2.1.4",
"@changesets/changelog-github": "^0.5.1",
"@changesets/cli": "^2.29.5",
"@cloudflare/workers-types": "^4.20250807.0",
Expand Down
Loading