Skip to content

Commit 93ad89a

Browse files
authored
chore: enable oxlint for the enable monorepo (#13173)
Also enabled `--type-aware`.
1 parent 98df7e8 commit 93ad89a

File tree

9 files changed

+124
-99
lines changed

9 files changed

+124
-99
lines changed

.github/renovate.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,15 @@
22
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
33
"extends": ["github>Boshen/renovate", "helpers:pinGitHubActionDigestsToSemver"],
44
"ignorePaths": ["crates/oxc_linter/fixtures/**"],
5-
"ignoreDeps": ["@types/vscode", "allocator-api2"]
5+
"ignoreDeps": ["@types/vscode", "allocator-api2"],
6+
"packageRules": [
7+
{
8+
"groupName": "oxlint",
9+
"matchManagers": ["npm"],
10+
"matchPackageNames": ["oxlint", "oxlint-tsgolint"],
11+
"rangeStrategy": "auto",
12+
"schedule": ["at any time"],
13+
"automergeSchedule": ["at any time"]
14+
}
15+
]
616
}

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ jobs:
211211
runs-on: ubuntu-latest
212212
steps:
213213
- uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
214+
- uses: oxc-project/setup-node@f42e3bda950c7454575e78ee4eaac880a077700c # v1.0.0
214215
- uses: oxc-project/setup-rust@cd82e1efec7fef815e2c23d296756f31c7cdc03d # v1.0.0
215216
with:
216217
save-cache: ${{ github.ref_name == 'main' }}
@@ -219,6 +220,7 @@ jobs:
219220
- run: cargo lint -- -D warnings
220221
- run: cargo lint --profile dev-no-debug-assertions -- -D warnings
221222
- run: RUSTDOCFLAGS='-D warnings' cargo doc --no-deps --document-private-items
223+
- run: node --run lint
222224

223225
conformance:
224226
name: Conformance

.github/workflows/ci_vscode.yml

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,28 +25,17 @@ concurrency:
2525
cancel-in-progress: ${{ github.ref_name != 'main' }}
2626

2727
jobs:
28-
lint:
29-
name: Check VSCode
28+
test:
29+
name: Test VSCode
3030
runs-on: ubuntu-latest
3131
steps:
3232
- uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
3333
- uses: oxc-project/setup-node@f42e3bda950c7454575e78ee4eaac880a077700c # v1.0.0
3434

35-
- name: Lint VSCode
36-
working-directory: editors/vscode
37-
run: pnpm run lint
38-
3935
- name: Type-Check VSCode
4036
working-directory: editors/vscode
4137
run: pnpm run type-check
4238

43-
test:
44-
name: Test VSCode
45-
runs-on: ubuntu-latest
46-
steps:
47-
- uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
48-
- uses: oxc-project/setup-node@f42e3bda950c7454575e78ee4eaac880a077700c # v1.0.0
49-
5039
- name: Build Language Server
5140
working-directory: editors/vscode
5241
run: pnpm run server:build:debug

editors/vscode/.oxlintrc.json

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

editors/vscode/client/ConfigService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export class ConfigService implements IDisposable {
8181

8282
dispose() {
8383
for (const disposable of this._disposables) {
84-
disposable.dispose();
84+
void disposable.dispose();
8585
}
8686
}
8787
}

editors/vscode/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@
181181
"install-extension": "code --install-extension oxc_language_server.vsix --force",
182182
"server:build:debug": "cross-env CARGO_TARGET_DIR=./target cargo build -p oxc_language_server",
183183
"server:build:release": "cross-env CARGO_TARGET_DIR=./target cargo build -p oxc_language_server --release",
184-
"lint": "npx oxlint --tsconfig=tsconfig.json",
185184
"test": "esbuild tests/*.spec.ts --bundle --outdir=out --external:vscode --format=cjs --platform=node --target=node16 --sourcemap && vscode-test",
186185
"type-check": "tsc --noEmit"
187186
},
@@ -195,8 +194,7 @@
195194
"cross-env": "^10.0.0",
196195
"esbuild": "^0.25.0",
197196
"ovsx": "^0.10.0",
198-
"oxlint": "^1.0.0",
199-
"typescript": "^5.4.5"
197+
"typescript": "catalog:"
200198
},
201199
"dependencies": {
202200
"vscode-languageclient": "^9.0.1"

oxlintrc.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"$schema": "./node_modules/oxlint/configuration_schema.json",
3+
"plugins": [
4+
"typescript",
5+
"unicorn",
6+
"react",
7+
"react-perf",
8+
"oxc",
9+
"import",
10+
"jsdoc",
11+
"node",
12+
"promise",
13+
"vitest"
14+
],
15+
"categories": {
16+
"correctness": "error",
17+
"perf": "error"
18+
},
19+
"ignorePatterns": [
20+
"**/fixtures/**",
21+
"**/generated/**",
22+
"npm/runtime/**",
23+
"tasks/coverage/**",
24+
"crates/oxc_semantic/tests/**",
25+
"tasks/e2e/**", // TODO
26+
"napi/**", // TODO
27+
"editors/vscode/tests/**", // TODO,
28+
"crates/oxc_traverse/scripts/lib/parse.mjs", // TODO
29+
"tasks/lint_rules/src/oxlint-rules.mjs", // TODO
30+
"tasks/transform_conformance/update_fixtures.mjs", // TODO
31+
"tasks/lint_rules/src/main.mjs" // TODO
32+
]
33+
}

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@
99
"build": "pnpm --workspace-concurrency=1 --filter './napi/*' build",
1010
"build-dev": "pnpm --workspace-concurrency=1 --filter './napi/*' build-dev",
1111
"build-test": "pnpm --workspace-concurrency=1 --filter './napi/*' build-test",
12-
"test": "pnpm --workspace-concurrency=1 --filter './napi/*' test"
12+
"test": "pnpm --workspace-concurrency=1 --filter './napi/*' test",
13+
"lint": "oxlint -c oxlintrc.json --type-aware --deny-warnings"
1314
},
1415
"devDependencies": {
1516
"@napi-rs/cli": "catalog:",
1617
"emnapi": "1.4.5",
17-
"oxlint-tsgolint": "0.0.3",
18+
"oxlint-tsgolint": "0.0.4",
19+
"oxlint": "^1.12.0",
1820
"typescript": "catalog:",
1921
"vitest": "catalog:"
2022
}

0 commit comments

Comments
 (0)