Skip to content

Commit c039387

Browse files
committed
Add linter, code formatter, and minor refactoring
- Add Biome for linting and formatting - Update package.json with linting scripts - Refactor imports and formatting in source files - Expand .gitignore for better coverage - Update license
1 parent c026eb6 commit c039387

File tree

10 files changed

+641
-514
lines changed

10 files changed

+641
-514
lines changed

.gitignore

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,59 @@
1-
# deps
1+
# Dependencies
22
node_modules/
3+
4+
# Bun
5+
.bun/
6+
bun.lockb
7+
8+
# Build outputs
9+
dist/
10+
build/
11+
out/
12+
13+
# Logs
14+
*.log
15+
logs/
16+
npm-debug.log*
17+
yarn-debug.log*
18+
yarn-error.log*
19+
pnpm-debug.log*
20+
lerna-debug.log*
21+
22+
# Runtime data
23+
pids/
24+
*.pid
25+
*.seed
26+
*.pid.lock
27+
28+
# Coverage directory used by tools like istanbul
29+
coverage/
30+
*.lcov
31+
32+
# Environment variables
33+
.env
34+
.env.local
35+
.env.development.local
36+
.env.test.local
37+
.env.production.local
38+
39+
# Editor directories and files
40+
.vscode/
41+
.idea/
42+
*.swp
43+
*.swo
44+
*~
45+
46+
# OS generated files
47+
.DS_Store
48+
.DS_Store?
49+
._*
50+
.Spotlight-V100
51+
.Trashes
52+
ehthumbs.db
53+
Thumbs.db
54+
55+
# Temporary files
56+
tmp/
57+
temp/
58+
.tmp/
59+
.temp/

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Borislav Ivanov, Redis Inc.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

biome.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.1.2/schema.json",
3+
"files": {
4+
"includes": ["src/**/*"]
5+
},
6+
"linter": {
7+
"enabled": true,
8+
"rules": {
9+
"recommended": true
10+
}
11+
},
12+
"formatter": {
13+
"enabled": true,
14+
"indentStyle": "tab",
15+
"lineWidth": 100
16+
},
17+
"overrides": [
18+
{
19+
"includes": ["**/*.test.ts", "**/*.spec.ts"],
20+
"linter": {
21+
"rules": {
22+
"suspicious": {
23+
"noExplicitAny": "off"
24+
}
25+
}
26+
}
27+
}
28+
]
29+
}

bun.lock

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,34 @@
1010
"zod": "^4.0.8",
1111
},
1212
"devDependencies": {
13+
"@biomejs/biome": "^2.1.2",
1314
"@types/bun": "latest",
1415
"redis": "^5.6.1",
1516
},
1617
},
1718
},
19+
"trustedDependencies": [
20+
"@biomejs/biome",
21+
],
1822
"packages": {
23+
"@biomejs/biome": ["@biomejs/[email protected]", "", { "optionalDependencies": { "@biomejs/cli-darwin-arm64": "2.1.2", "@biomejs/cli-darwin-x64": "2.1.2", "@biomejs/cli-linux-arm64": "2.1.2", "@biomejs/cli-linux-arm64-musl": "2.1.2", "@biomejs/cli-linux-x64": "2.1.2", "@biomejs/cli-linux-x64-musl": "2.1.2", "@biomejs/cli-win32-arm64": "2.1.2", "@biomejs/cli-win32-x64": "2.1.2" }, "bin": { "biome": "bin/biome" } }, "sha512-yq8ZZuKuBVDgAS76LWCfFKHSYIAgqkxVB3mGVVpOe2vSkUTs7xG46zXZeNPRNVjiJuw0SZ3+J2rXiYx0RUpfGg=="],
24+
25+
"@biomejs/cli-darwin-arm64": ["@biomejs/[email protected]", "", { "os": "darwin", "cpu": "arm64" }, "sha512-leFAks64PEIjc7MY/cLjE8u5OcfBKkcDB0szxsWUB4aDfemBep1WVKt0qrEyqZBOW8LPHzrFMyDl3FhuuA0E7g=="],
26+
27+
"@biomejs/cli-darwin-x64": ["@biomejs/[email protected]", "", { "os": "darwin", "cpu": "x64" }, "sha512-Nmmv7wRX5Nj7lGmz0FjnWdflJg4zii8Ivruas6PBKzw5SJX/q+Zh2RfnO+bBnuKLXpj8kiI2x2X12otpH6a32A=="],
28+
29+
"@biomejs/cli-linux-arm64": ["@biomejs/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-NWNy2Diocav61HZiv2enTQykbPP/KrA/baS7JsLSojC7Xxh2nl9IczuvE5UID7+ksRy2e7yH7klm/WkA72G1dw=="],
30+
31+
"@biomejs/cli-linux-arm64-musl": ["@biomejs/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-qgHvafhjH7Oca114FdOScmIKf1DlXT1LqbOrrbR30kQDLFPEOpBG0uzx6MhmsrmhGiCFCr2obDamu+czk+X0HQ=="],
32+
33+
"@biomejs/cli-linux-x64": ["@biomejs/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-Km/UYeVowygTjpX6sGBzlizjakLoMQkxWbruVZSNE6osuSI63i4uCeIL+6q2AJlD3dxoiBJX70dn1enjQnQqwA=="],
34+
35+
"@biomejs/cli-linux-x64-musl": ["@biomejs/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-xlB3mU14ZUa3wzLtXfmk2IMOGL+S0aHFhSix/nssWS/2XlD27q+S6f0dlQ8WOCbYoXcuz8BCM7rCn2lxdTrlQA=="],
36+
37+
"@biomejs/cli-win32-arm64": ["@biomejs/[email protected]", "", { "os": "win32", "cpu": "arm64" }, "sha512-G8KWZli5ASOXA3yUQgx+M4pZRv3ND16h77UsdunUL17uYpcL/UC7RkWTdkfvMQvogVsAuz5JUcBDjgZHXxlKoA=="],
38+
39+
"@biomejs/cli-win32-x64": ["@biomejs/[email protected]", "", { "os": "win32", "cpu": "x64" }, "sha512-9zajnk59PMpjBkty3bK2IrjUsUHvqe9HWwyAWQBjGLE7MIBjbX2vwv1XPEhmO2RRuGoTkVx3WCanHrjAytICLA=="],
40+
1941
"@hono/zod-validator": ["@hono/[email protected]", "", { "peerDependencies": { "hono": ">=3.9.0", "zod": "^3.25.0 || ^4.0.0" } }, "sha512-ub5eL/NeZ4eLZawu78JpW/J+dugDAYhwqUIdp9KYScI6PZECij4Hx4UsrthlEUutqDDhPwRI0MscUfNkvn/mqQ=="],
2042

2143
"@redis/bloom": ["@redis/[email protected]", "", { "peerDependencies": { "@redis/client": "^5.6.1" } }, "sha512-5/22U76IMEfn6TeZ+uvjXspHw+ykBF0kpBa8xouzeHaQMXs/auqBUOEYzU2VKYDvnd2RSpPTyIg82oB7PpUgLg=="],

package.json

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
{
22
"name": "resp-proxy",
3+
"version": "1.0.0",
4+
"description": "A Redis RESP protocol proxy server",
5+
"author": "Borislav Ivanov <[email protected]> (Redis Inc)",
6+
"license": "MIT",
37
"scripts": {
8+
"clean": "rm -rf node_modules .bun dist build out coverage tmp temp logs *.log",
9+
"start": "bun run src/index.ts",
410
"proxy": "bun run src/index.ts",
511
"dev": "bun run --hot src/index.ts",
6-
"test": "bun test **/*.test.ts"
12+
"test": "bun test",
13+
"test:watch": "bun test --watch",
14+
"type-check": "bunx tsc --noEmit",
15+
"lint": "bunx @biomejs/biome check src/",
16+
"lint:fix": "bunx @biomejs/biome check --apply src/",
17+
"format": "bunx @biomejs/biome format --write src/"
718
},
819
"dependencies": {
920
"@hono/zod-validator": "^0.7.2",
@@ -12,7 +23,11 @@
1223
"zod": "^4.0.8"
1324
},
1425
"devDependencies": {
26+
"@biomejs/biome": "^2.1.2",
1527
"@types/bun": "latest",
1628
"redis": "^5.6.1"
17-
}
29+
},
30+
"trustedDependencies": [
31+
"@biomejs/biome"
32+
]
1833
}

0 commit comments

Comments
 (0)