Skip to content

Commit 13505dc

Browse files
committed
feat(dev): Add oxlint to the project
* Add oxlint for linting and type checking * Update prettier config to be aware of tailwind CSS * Add a CI workflow to run both on all PRs * Run both tools and accept all edits to get a good baseline
1 parent 31d6326 commit 13505dc

34 files changed

Lines changed: 524 additions & 405 deletions

.github/workflows/format-lint.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Format & Lint
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
- reopened
9+
- ready_for_review
10+
11+
permissions:
12+
contents: read
13+
14+
concurrency:
15+
group: format-lint-${{ github.event.pull_request.number || github.ref }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
format-and-lint:
20+
name: fmt & lint
21+
runs-on: ubuntu-22.04
22+
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@v6
26+
27+
- name: Set up Bun
28+
uses: oven-sh/setup-bun@v2
29+
30+
- name: Install dependencies
31+
run: bun ci
32+
33+
- name: Check formatting
34+
run: bun run fmt:check
35+
36+
- name: Run lint (CI format)
37+
run: bun run lint:ci

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,13 @@ result
1010
package-lock.json
1111
# src/renderer/public/*
1212

13+
AGENTS.md
14+
CLAUDE.md
15+
.codex
16+
.claude
17+
1318
# Custom
1419
# *.exe
1520
temp
1621
guest_server/winboat_guest_server.exe
17-
guest_server/winboat_guest_server.zip
22+
guest_server/winboat_guest_server.zip

.oxlintrc.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "./node_modules/oxlint/configuration_schema.json",
3+
"plugins": ["typescript", "unicorn", "oxc", "vue"],
4+
"categories": {
5+
"correctness": "error"
6+
},
7+
"rules": {},
8+
"env": {
9+
"builtin": true
10+
},
11+
"ignorePatterns": ["/src/renderer/public/xel"],
12+
"options": {
13+
"typeAware": true,
14+
"typeCheck": true
15+
}
16+
}

.prettierignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
21
# Ignore xel's files
32
/src/renderer/public/xel
3+

.prettierrc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
22
"tabWidth": 4,
33
"printWidth": 120,
4-
"arrowParens": "avoid"
4+
"arrowParens": "avoid",
5+
"plugins": ["prettier-plugin-tailwindcss"],
6+
"tailwindConfig": "./tailwind.config.ts"
57
}

README.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,18 @@ Before running WinBoat, ensure your system meets the following requirements:
4848
- **Virtualization**: KVM enabled in BIOS/UEFI
4949
- [How to enable virtualization](https://duckduckgo.com/?t=h_&q=how+to+enable+virtualization+in+%3Cmotherboard+brand%3E+bios&ia=web)
5050
- **In case of Docker:**
51-
- **Docker**: Required for containerization
52-
- [Installation Guide](https://docs.docker.com/engine/install/)
53-
- **⚠️ NOTE:** Docker Desktop is **not** supported, you will run into issues if you use it
54-
- **Docker Compose v2**: Required for compatibility with docker-compose.yml files
55-
- [Installation Guide](https://docs.docker.com/compose/install/#plugin-linux-only)
56-
- **Docker User Group**: Add your user to the `docker` group
57-
- [Setup Instructions](https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user)
51+
- **Docker**: Required for containerization
52+
- [Installation Guide](https://docs.docker.com/engine/install/)
53+
- **⚠️ NOTE:** Docker Desktop is **not** supported, you will run into issues if you use it
54+
- **Docker Compose v2**: Required for compatibility with docker-compose.yml files
55+
- [Installation Guide](https://docs.docker.com/compose/install/#plugin-linux-only)
56+
- **Docker User Group**: Add your user to the `docker` group
57+
- [Setup Instructions](https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user)
5858
- **In case of Podman:**
59-
- **Podman**: Required for containerization
60-
- [Installation Guide](https://podman.io/docs/installation#installing-on-linux)
61-
- **Podman Compose**: Required for compatibility with podman-compose.yml files
62-
- [Installation Guide](https://github.com/containers/podman-compose?tab=readme-ov-file#installation)
59+
- **Podman**: Required for containerization
60+
- [Installation Guide](https://podman.io/docs/installation#installing-on-linux)
61+
- **Podman Compose**: Required for compatibility with podman-compose.yml files
62+
- [Installation Guide](https://github.com/containers/podman-compose?tab=readme-ov-file#installation)
6363
- **FreeRDP**: Required for remote desktop connection (Please make sure you have **Version 3.x.x** with sound support included)
6464
- [Installation Guide](https://github.com/FreeRDP/FreeRDP/wiki/PreBuilds)
6565
- [OPTIONAL] **Kernel Modules**: The `iptables` / `nftables` and `iptable_nat` kernel modules can be loaded for network autodiscovery and better shared filesystem performance, but this is not obligatory in newer versions of WinBoat
@@ -75,12 +75,13 @@ You can download the latest Linux builds under the [Releases](https://github.com
7575
- **.rpm:** The intended format for Fedora based distributions
7676
- **Nix (Nixpkgs)**
7777
1. Add the winboat package to your config (ensure using nixpkgs-unstable)
78-
using `environment.systemPackages = [pkgs.winboat];` or `home.packages = [pkgs.winboat];` if using home manager.
78+
using `environment.systemPackages = [pkgs.winboat];` or `home.packages = [pkgs.winboat];` if using home manager.
7979
2. Add the following lines to your nix configuration
8080
```nix
8181
virtualisation.docker.enable = true;
8282
users.users.{yourUser}.extraGroups = ["docker"];
8383
```
84+
8485
## Known Issues About Container Runtimes
8586
8687
- Docker Desktop is **unsupported** for now

bun.lock

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

package.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,18 @@
55
"type": "module",
66
"main": "main/main.js",
77
"engines": {
8-
"node": ">=23.6.0",
8+
"node": ">=24.11.0",
99
"bun": ">=1.3.0"
1010
},
1111
"scripts": {
1212
"dev": "bun scripts/dev-server.ts",
1313
"build:gs": "bash build-guest-server.sh",
14-
"build:linux-gs": "bash build-guest-server.sh && bun scripts/build.ts && electron-builder --linux"
14+
"build:linux-gs": "bash build-guest-server.sh && bun scripts/build.ts && electron-builder --linux",
15+
"lint": "oxlint",
16+
"lint:fix": "oxlint --fix",
17+
"lint:ci": "oxlint --format=github",
18+
"fmt": "prettier . --write",
19+
"fmt:check": "prettier . --check"
1520
},
1621
"repository": "https://github.com/TibixDev/winboat",
1722
"author": {
@@ -21,15 +26,19 @@
2126
},
2227
"devDependencies": {
2328
"@types/node-fetch": "^2.6.13",
29+
"@types/pngjs": "^6.0.5",
2430
"@types/turndown": "^5.0.6",
2531
"@vitejs/plugin-vue": "^6.0.4",
2632
"autoprefixer": "^10.4.24",
2733
"chalk": "^5.6.2",
2834
"chokidar": "^5.0.0",
2935
"electron": "^40.2.1",
3036
"electron-builder": "^26.7.0",
37+
"oxlint": "^1.64.0",
38+
"oxlint-tsgolint": "^0.22.1",
3139
"postcss": "^8.5.6",
32-
"prettier": "3.8.1",
40+
"prettier": "^3.8.3",
41+
"prettier-plugin-tailwindcss": "^0.8.0",
3342
"tailwindcss": "^3.4.17",
3443
"typescript": "~5.9.3",
3544
"vite": "^7.3.1",

scripts/build.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,21 @@ function buildMain() {
2222
return compileTs(mainPath);
2323
}
2424

25-
FileSystem.rmSync(Path.join(__dirname, "..", "build"), {
26-
recursive: true,
27-
force: true,
28-
});
25+
async function build() {
26+
FileSystem.rmSync(Path.join(__dirname, "..", "build"), {
27+
recursive: true,
28+
force: true,
29+
});
2930

30-
console.log(Chalk.blueBright("Transpiling renderer & main..."));
31+
console.log(Chalk.blueBright("Transpiling renderer & main..."));
3132

32-
Promise.allSettled([buildRenderer(), buildMain()]).then(() => {
33+
await Promise.all([buildRenderer(), buildMain()]);
3334
console.log(
3435
Chalk.greenBright("Renderer & main successfully transpiled! (ready to be built with electron-builder)"),
3536
);
37+
}
38+
39+
void build().catch(error => {
40+
console.error(error);
41+
process.exitCode = 1;
3642
});

0 commit comments

Comments
 (0)