Skip to content

Commit e6af233

Browse files
committed
Update linting, add CI, and fix up some things.
1 parent 478948c commit e6af233

File tree

8 files changed

+28
-27
lines changed

8 files changed

+28
-27
lines changed

.github/workflows/CI.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v4
11+
- uses: oven-sh/setup-bun@v1
12+
- run: make setup
13+
- run: make lint

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ dev: setup
1010
.PHONY: lint
1111
lint: setup
1212
bun x @biomejs/biome check
13+
bun x tsc --noEmit --project .
1314

1415
.PHONY: format
1516
format: setup

biome.json

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,7 @@
11
{
22
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
3+
"extends": ["./node_modules/@cubing/dev-config/biome/biome.json"],
34
"files": {
45
"includes": ["**", "!dist", "!package.json"]
5-
},
6-
"formatter": {
7-
"indentStyle": "space",
8-
"indentWidth": 2
9-
},
10-
"linter": {
11-
"rules": {
12-
"style": {
13-
"noParameterAssign": "error",
14-
"useAsConstAssertion": "error",
15-
"useDefaultParameterLast": "error",
16-
"useEnumInitializers": "error",
17-
"useSelfClosingElements": "error",
18-
"useSingleVarDeclarator": "error",
19-
"noUnusedTemplateLiteral": "error",
20-
"useNumberNamespace": "error",
21-
"noInferrableTypes": "error",
22-
"noUselessElse": "error"
23-
}
24-
}
256
}
267
}

bun.lock

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

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
},
1414
"devDependencies": {
1515
"@biomejs/biome": "^2.0.6",
16+
"@cubing/dev-config": "^0.3.6",
1617
"@types/bun": "^1.2.17",
1718
"barely-a-dev-server": "^0.8.1",
1819
"esbuild": "^0.25.5"

script/build.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export async function listFiles(
3131
);
3232

3333
const ownMatches = [];
34-
let recursiveMatches = [];
34+
let recursiveMatches: string[] = [];
3535
for (const childName of childNames) {
3636
const newRelativePath = relativePath
3737
? join(relativePath, childName)
@@ -47,7 +47,7 @@ export async function listFiles(
4747
return ownMatches.concat(recursiveMatches);
4848
}
4949

50-
const hashes = {};
50+
const hashes: Record<string, string> = {};
5151
for (const path of await listFiles(
5252
ADDON_DIST_DIR,
5353
(name) => name !== ".DS_Store" && !name.endsWith("/.DS_Store"),

tsconfig.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
{
2-
"compilerOptions": {
3-
"target": "es2022",
4-
"module": "es2022",
5-
"moduleResolution": "bundler"
6-
}
2+
"extends": "./tsconfig.jsonc"
73
}

tsconfig.jsonc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"$schema": "https://json.schemastore.org/tsconfig",
3+
"extends": "./node_modules/@cubing/dev-config/ts/es2022-types/tsconfig.json",
4+
"compilerOptions": {
5+
// TODO: this should not be necessary. `@types/node` and `@types/bun` have been compatible for a while, and we're avoiding other dependency versions that would mess with that.
6+
"skipLibCheck": true
7+
}
8+
}

0 commit comments

Comments
 (0)