Skip to content

Commit 9cc799c

Browse files
committed
fix: linting
1 parent 6cea8f4 commit 9cc799c

File tree

8 files changed

+38
-47
lines changed

8 files changed

+38
-47
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ jobs:
2828
- name: Install dependencies
2929
run: nix develop --command pnpm install --frozen-lockfile
3030

31-
- name: Type check
32-
run: nix develop --command pnpm typecheck
31+
- name: Build
32+
run: nix develop --command pnpm build
3333

3434
- name: Lint
3535
run: nix develop --command pnpm lint

biome.jsonc

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
11
{
22
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
33
"vcs": {
4-
"enabled": false,
4+
"enabled": true,
55
"clientKind": "git",
6-
"useIgnoreFile": false
7-
},
8-
"files": {
9-
"ignoreUnknown": false
6+
"useIgnoreFile": true
107
},
118
"formatter": {
129
"enabled": true,
13-
"includes": ["packages/**/src/**/*.ts"],
1410
"indentStyle": "space",
1511
"indentWidth": 2
1612
},
1713
"linter": {
1814
"enabled": true,
19-
"includes": ["packages/**/src/**/*.ts"],
2015
"rules": {
2116
"recommended": true
2217
}

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@
2929
"format:fix": "biome format --write .",
3030
"lint": "biome lint .",
3131
"lint:fix": "biome lint --write .",
32-
"test": "pnpm -r test",
33-
"typecheck": "pnpm -r typecheck"
32+
"test": "pnpm -r test"
3433
},
3534
"type": "module"
3635
}

packages/github/cli/commands/record.ts

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import {
99
HttpRecorder,
1010
HttpRecorderConfig,
11-
RedactionContext,
11+
type RedactionContext,
1212
RedactionResult,
1313
} from '@akoenig/effect-http-recorder'
1414
import { Command, Options } from '@effect/cli'
@@ -81,7 +81,7 @@ const createGitHubRedactionEffect = (context: RedactionContext) => {
8181
/**
8282
* Recursively redact sensitive data while preserving GitHub API data structure
8383
*/
84-
const redactGitHubData = (obj: any): any => {
84+
const redactGitHubData = (obj: unknown): unknown => {
8585
if (!obj || typeof obj !== 'object') {
8686
return obj
8787
}
@@ -90,7 +90,7 @@ const redactGitHubData = (obj: any): any => {
9090
return obj.map(redactGitHubData)
9191
}
9292

93-
const redacted = { ...obj }
93+
const redacted = { ...(obj as Record<string, unknown>) }
9494

9595
// IDs and unique identifiers
9696
if (
@@ -204,28 +204,28 @@ const redactGitHubData = (obj: any): any => {
204204
if ('url' in redacted && typeof redacted.url === 'string') {
205205
redacted.url = redacted.url
206206
// Replace GitHub.com URLs
207-
.replace(/github\.com\/[^\/]+/g, 'github.com/example-user')
207+
.replace(/github\.com\/[^/]+/g, 'github.com/example-user')
208208
// Replace API URLs - handle all patterns
209209
.replace(
210-
/api\.github\.com\/repos\/[^\/]+\/[^\/]+/g,
210+
/api\.github\.com\/repos\/[^/]+\/[^/]+/g,
211211
'api.github.com/repos/example-user/example-repo',
212212
)
213213
.replace(
214-
/api\.github\.com\/users\/[^\/]+/g,
214+
/api\.github\.com\/users\/[^/]+/g,
215215
'api.github.com/users/example-user',
216216
)
217217
.replace(
218-
/api\.github\.com\/orgs\/[^\/]+/g,
218+
/api\.github\.com\/orgs\/[^/]+/g,
219219
'api.github.com/orgs/example-org',
220220
)
221221
// Handle the pattern: api.github.com/example-user/{actual-username}/{repo-name}
222222
.replace(
223-
/api\.github\.com\/example-user\/[^\/]+\/[^\/]+/g,
223+
/api\.github\.com\/example-user\/[^/]+\/[^/]+/g,
224224
'api.github.com/repos/example-user/example-repo',
225225
)
226226
// Handle the pattern: api.github.com/example-user/{actual-username}
227227
.replace(
228-
/api\.github\.com\/example-user\/[^\/]+$/g,
228+
/api\.github\.com\/example-user\/[^/]+$/g,
229229
'api.github.com/users/example-user',
230230
)
231231
// Replace PR and issue numbers
@@ -234,42 +234,42 @@ const redactGitHubData = (obj: any): any => {
234234
}
235235
if ('html_url' in redacted && typeof redacted.html_url === 'string') {
236236
redacted.html_url = redacted.html_url
237-
.replace(/github\.com\/[^\/]+/g, 'github.com/example-user')
237+
.replace(/github\.com\/[^/]+/g, 'github.com/example-user')
238238
// Handle patterns where example-user is already present
239239
.replace(
240-
/github\.com\/example-user\/[^\/]+/g,
240+
/github\.com\/example-user\/[^/]+/g,
241241
'github.com/example-user/example-repo',
242242
)
243243
}
244244
if ('clone_url' in redacted && typeof redacted.clone_url === 'string') {
245245
redacted.clone_url = redacted.clone_url
246-
.replace(/github\.com\/[^\/]+/g, 'github.com/example-user')
246+
.replace(/github\.com\/[^/]+/g, 'github.com/example-user')
247247
.replace(
248-
/github\.com\/example-user\/[^\/]+/g,
248+
/github\.com\/example-user\/[^/]+/g,
249249
'github.com/example-user/example-repo',
250250
)
251251
}
252252
if ('ssh_url' in redacted && typeof redacted.ssh_url === 'string') {
253253
redacted.ssh_url = redacted.ssh_url
254-
.replace(/github\.com:[^\/]+/g, 'github.com:example-user')
254+
.replace(/github\.com:[^/]+/g, 'github.com:example-user')
255255
.replace(
256-
/github\.com:example-user\/[^\/]+/g,
256+
/github\.com:example-user\/[^/]+/g,
257257
'github.com:example-user/example-repo',
258258
)
259259
}
260260
if ('git_url' in redacted && typeof redacted.git_url === 'string') {
261261
redacted.git_url = redacted.git_url
262-
.replace(/github\.com\/[^\/]+/g, 'github.com/example-user')
262+
.replace(/github\.com\/[^/]+/g, 'github.com/example-user')
263263
.replace(
264-
/github\.com\/example-user\/[^\/]+/g,
264+
/github\.com\/example-user\/[^/]+/g,
265265
'github.com/example-user/example-repo',
266266
)
267267
}
268268
if ('svn_url' in redacted && typeof redacted.svn_url === 'string') {
269269
redacted.svn_url = redacted.svn_url
270-
.replace(/github\.com\/[^\/]+/g, 'github.com/example-user')
270+
.replace(/github\.com\/[^/]+/g, 'github.com/example-user')
271271
.replace(
272-
/github\.com\/example-user\/[^\/]+/g,
272+
/github\.com\/example-user\/[^/]+/g,
273273
'github.com/example-user/example-repo',
274274
)
275275
}
@@ -284,11 +284,11 @@ const redactGitHubData = (obj: any): any => {
284284
) {
285285
redacted.latest_comment_url = redacted.latest_comment_url
286286
.replace(
287-
/api\.github\.com\/repos\/[^\/]+\/[^\/]+/g,
287+
/api\.github\.com\/repos\/[^/]+\/[^/]+/g,
288288
'api.github.com/repos/example-user/example-repo',
289289
)
290290
.replace(
291-
/api\.github\.com\/example-user\/[^\/]+\/[^\/]+/g,
291+
/api\.github\.com\/example-user\/[^/]+\/[^/]+/g,
292292
'api.github.com/repos/example-user/example-repo',
293293
)
294294
.replace(/\/comments\/\d+/g, '/comments/12345')
@@ -347,31 +347,31 @@ const redactGitHubData = (obj: any): any => {
347347
if (field in redacted && typeof redacted[field] === 'string') {
348348
redacted[field] = redacted[field]
349349
// Replace GitHub.com URLs
350-
.replace(/github\.com\/[^\/]+/g, 'github.com/example-user')
350+
.replace(/github\.com\/[^/]+/g, 'github.com/example-user')
351351
// Replace API URLs - handle all patterns
352352
.replace(
353-
/api\.github\.com\/repos\/[^\/]+\/[^\/]+/g,
353+
/api\.github\.com\/repos\/[^/]+\/[^/]+/g,
354354
'api.github.com/repos/example-user/example-repo',
355355
)
356356
.replace(
357-
/api\.github\.com\/users\/[^\/]+/g,
357+
/api\.github\.com\/users\/[^/]+/g,
358358
'api.github.com/users/example-user',
359359
)
360360
.replace(
361-
/api\.github\.com\/orgs\/[^\/]+/g,
361+
/api\.github\.com\/orgs\/[^/]+/g,
362362
'api.github.com/orgs/example-org',
363363
)
364364
// Handle patterns where example-user is already present
365365
.replace(
366-
/api\.github\.com\/example-user\/[^\/]+\/[^\/]+/g,
366+
/api\.github\.com\/example-user\/[^/]+\/[^/]+/g,
367367
'api.github.com/repos/example-user/example-repo',
368368
)
369369
.replace(
370-
/api\.github\.com\/example-user\/[^\/]+(?=\/|$)/g,
370+
/api\.github\.com\/example-user\/[^/]+(?=\/|$)/g,
371371
'api.github.com/users/example-user',
372372
)
373373
.replace(
374-
/github\.com\/example-user\/[^\/]+/g,
374+
/github\.com\/example-user\/[^/]+/g,
375375
'github.com/example-user/example-repo',
376376
)
377377
}
@@ -393,8 +393,8 @@ const redactGitHubData = (obj: any): any => {
393393

394394
// Recursively process arrays and nested objects
395395
Object.keys(redacted).forEach((key) => {
396-
if (typeof redacted[key] === 'object' && redacted[key] !== null) {
397-
redacted[key] = redactGitHubData(redacted[key])
396+
if (typeof redacted[key as keyof typeof redacted] === 'object' && redacted[key as keyof typeof redacted] !== null) {
397+
redacted[key as keyof typeof redacted] = redactGitHubData(redacted[key as keyof typeof redacted])
398398
}
399399
})
400400

packages/github/cli/main.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
*/
77

88
import { Command } from '@effect/cli'
9-
import { HttpClient } from '@effect/platform'
109
import { NodeContext, NodeHttpClient, NodeRuntime } from '@effect/platform-node'
1110
import { Effect, Layer } from 'effect'
1211
import { buildCommand } from './commands/build.js'

packages/github/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@
4444
"cli": "tsx cli/main.ts",
4545
"cli:clean": "tsx cli/main.ts clean",
4646
"cli:record": "tsx cli/main.ts record",
47-
"cli:test": "tsx cli/main.ts test",
48-
"typecheck": "tsc --noEmit"
47+
"cli:test": "tsx cli/main.ts test"
4948
},
5049
"type": "module"
5150
}

packages/http-recorder/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@
3838
"scripts": {
3939
"build": "tsc -b",
4040
"clean": "rm -rf dist .tsbuildinfo",
41-
"test": "vitest run",
42-
"typecheck": "tsc --noEmit"
41+
"test": "vitest run"
4342
},
4443
"type": "module"
4544
}

packages/http-recorder/scratchpad/mod.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { NodeContext, NodeHttpClient } from '@effect/platform-node'
33
import { Effect, Layer } from 'effect'
44
import { HttpRecorder, HttpReplayer } from '../dist/mod.js'
55

6-
const recorder = HttpRecorder.layer({
6+
const _recorder = HttpRecorder.layer({
77
path: './recordings',
88
})
99

0 commit comments

Comments
 (0)