Skip to content

Commit 09c6b08

Browse files
authored
oxlint + oxfmt (#15)
1 parent f2d15a7 commit 09c6b08

21 files changed

Lines changed: 332 additions & 206 deletions

.changeset/kind-pandas-listen.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"gitlab-dynamic-pipelines": major
3+
---
4+
5+
Use oxlint + oxfmt to lint:fix and format this codebase

.github/workflows/ci.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,21 @@ jobs:
2020
- name: Use Node.js
2121
uses: actions/setup-node@v6
2222
with:
23-
node-version: "24"
23+
node-version: '24'
2424

2525
- uses: pnpm/action-setup@v4
2626

2727
- name: Install dependencies
2828
run: pnpm install
2929

30-
- name: Run CI
31-
run: pnpm run ci
30+
- name: Run unit tests
31+
run: pnpm test
32+
33+
- name: Check formatting
34+
run: pnpm format:check
35+
36+
- name: Lint
37+
run: pnpm lint
38+
39+
- name: Build
40+
run: pnpm build

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Setup Node.js
2424
uses: actions/setup-node@v6
2525
with:
26-
node-version: "24"
26+
node-version: '24'
2727

2828
- uses: pnpm/action-setup@v4
2929

.oxfmtrc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"$schema": "./node_modules/oxfmt/configuration_schema.json",
3+
"ignorePatterns": [".changeset/*.md"],
4+
"singleQuote": true
5+
}

.oxlintrc.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"$schema": "./node_modules/oxlint/configuration_schema.json",
3+
"categories": {
4+
"correctness": "error",
5+
"style": "error",
6+
"suspicious": "error"
7+
},
8+
"rules": {
9+
"array-callback-return": "error",
10+
"arrow-body-style": "off",
11+
"eqeqeq": "error",
12+
"func-style": ["error", "declaration"],
13+
"id-length": "off",
14+
"import/extensions": ["error", "always", { "ignorePackages": true }],
15+
"import/no-amd": "error",
16+
"import/no-commonjs": "error",
17+
"import/no-cycle": "error",
18+
"import/no-default-export": "error",
19+
"max-statements": "off",
20+
"no-fallthrough": "error",
21+
"no-empty": "error",
22+
"no-iterator": "error",
23+
"no-magic-numbers": "off",
24+
"no-new-wrappers": "error",
25+
"no-proto": "error",
26+
"no-sequences": "error",
27+
"no-ternary": "off",
28+
"no-throw-literal": "error",
29+
"no-restricted-globals": ["error", "event", "name", "length"],
30+
"no-var": "error",
31+
"no-void": "error",
32+
"oxc/no-accumulating-spread": "error",
33+
"radix": "error",
34+
"sort-imports": ["error", { "ignoreDeclarationSort": true }],
35+
"sort-keys": "off",
36+
"typescript/no-explicit-any": "error",
37+
"typescript/no-require-imports": "error",
38+
"unicorn/filename-case": [
39+
"error",
40+
{ "cases": { "camelCase": true, "kebabCase": false, "pascalCase": true, "snakeCase": false } }
41+
],
42+
"unicorn/no-null": "off",
43+
"unicorn/prefer-array-flat-map": "error",
44+
"unicorn/prefer-set-has": "error"
45+
}
46+
}

biome.json

Lines changed: 0 additions & 30 deletions
This file was deleted.

package.json

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,40 @@
22
"name": "gitlab-dynamic-pipelines",
33
"version": "1.1.0",
44
"description": "Create dynamic Gitlab CI/CD pipelines using TypeScript with types",
5-
"main": "dist/index.js",
6-
"types": "dist/index.d.ts",
7-
"type": "module",
8-
"packageManager": "pnpm@10.26.2+sha512.0e308ff2005fc7410366f154f625f6631ab2b16b1d2e70238444dd6ae9d630a8482d92a451144debc492416896ed16f7b114a86ec68b8404b2443869e68ffda6",
9-
"scripts": {
10-
"build": "rm -rf dist && tsc",
11-
"check-format": "biome check .",
12-
"ci": "pnpm run test && pnpm run check-format",
13-
"format": "biome check --write .",
14-
"prepublishOnly": "pnpm run ci",
15-
"test": "pnpm run build && node --test"
16-
},
17-
"repository": {
18-
"type": "git",
19-
"url": "git+https://github.com/onlywei/gitlab-dynamic-pipelines.git"
20-
},
215
"keywords": [
226
"gitlab"
237
],
24-
"author": "Wei Wang <wei@fastmail.com>",
25-
"license": "MIT",
8+
"homepage": "https://github.com/onlywei/gitlab-dynamic-pipelines#readme",
269
"bugs": {
2710
"url": "https://github.com/onlywei/gitlab-dynamic-pipelines/issues"
2811
},
29-
"homepage": "https://github.com/onlywei/gitlab-dynamic-pipelines#readme",
12+
"license": "MIT",
13+
"author": "Wei Wang <wei@fastmail.com>",
14+
"repository": {
15+
"type": "git",
16+
"url": "git+https://github.com/onlywei/gitlab-dynamic-pipelines.git"
17+
},
18+
"type": "module",
19+
"main": "dist/index.js",
20+
"types": "dist/index.d.ts",
21+
"scripts": {
22+
"build": "rm -rf dist && tsc",
23+
"format": "oxfmt --write .",
24+
"format:check": "oxfmt --check .",
25+
"lint": "oxlint .",
26+
"lint:fix": "oxlint --fix .",
27+
"prepublishOnly": "pnpm build",
28+
"test": "node --test"
29+
},
30+
"dependencies": {
31+
"yaml": "^2.8.2"
32+
},
3033
"devDependencies": {
31-
"@biomejs/biome": "^2.3.10",
3234
"@changesets/cli": "^2.29.8",
3335
"@types/node": "^24.10.4",
36+
"oxfmt": "^0.23.0",
37+
"oxlint": "^1.38.0",
3438
"typescript": "^5.9.3"
3539
},
36-
"dependencies": {
37-
"yaml": "^2.8.2"
38-
}
40+
"packageManager": "pnpm@10.26.2+sha512.0e308ff2005fc7410366f154f625f6631ab2b16b1d2e70238444dd6ae9d630a8482d92a451144debc492416896ed16f7b114a86ec68b8404b2443869e68ffda6"
3941
}

0 commit comments

Comments
 (0)