Skip to content

Commit 2e9bd5e

Browse files
authored
Migrate JS lint and format tooling to Oxlint and Oxfmt (#78)
This PR swaps ESLint and Prettier for Oxlint and Oxfmt, extending the shared `@solana-config/oxc` package, to align the JS client tooling with the converged Solana program-client conventions and gain the substantial speed-up of the Rust-based toolchain. The configs are authored in CommonJS-style `.ts` so they autodiscover under the package's `"type": "commonjs"`, the `sort-keys` rule is disabled to preserve the previous ESLint behaviour, and the CI Node version is bumped to 24 so the TypeScript-strip loader handles `.ts` configs cleanly. The root `package.json` drops `@solana/prettier-config-solana`, and `codama.json` gains an explicit `prettierOptions` block so future client regenerations match the new style without re-introducing Prettier as a dev tool.
1 parent acd102a commit 2e9bd5e

20 files changed

Lines changed: 802 additions & 3676 deletions

.github/actions/setup/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ runs:
3838
if: ${{ inputs.pnpm == 'true' }}
3939
uses: actions/setup-node@v4
4040
with:
41-
node-version: 20
41+
node-version: 24
4242
cache: 'pnpm'
4343

4444
- name: Install Dependencies

clients/js/.prettierignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

clients/js/eslint.config.mjs

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

clients/js/oxfmt.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const oxfmt = require('oxfmt');
2+
const solanaFmt = require('@solana-config/oxc/oxfmt');
3+
4+
module.exports = oxfmt.defineConfig({
5+
...solanaFmt,
6+
ignorePatterns: ['**/dist/**', 'src/generated/**', 'test-ledger/**'],
7+
});

clients/js/oxlint.config.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const oxlint = require('oxlint');
2+
const solanaConfig = require('@solana-config/oxc/oxlint');
3+
4+
module.exports = oxlint.defineConfig({
5+
extends: [solanaConfig],
6+
ignorePatterns: ['**/dist/**', 'src/generated/**', 'test-ledger/**'],
7+
options: { typeAware: true },
8+
rules: { 'sort-keys': 'off' },
9+
});

clients/js/package.json

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,62 +2,63 @@
22
"name": "@solana-program/system",
33
"version": "0.12.0",
44
"description": "JavaScript client for the System program",
5+
"homepage": "https://github.com/solana-program/system#readme",
6+
"bugs": {
7+
"url": "https://github.com/solana-program/system/issues"
8+
},
9+
"license": "Apache-2.0",
10+
"repository": {
11+
"type": "git",
12+
"url": "git+https://github.com/solana-program/system.git"
13+
},
14+
"files": [
15+
"./dist/src",
16+
"./dist/types",
17+
"./src/"
18+
],
19+
"type": "commonjs",
520
"sideEffects": false,
6-
"module": "./dist/src/index.mjs",
721
"main": "./dist/src/index.js",
22+
"module": "./dist/src/index.mjs",
823
"types": "./dist/types/index.d.ts",
9-
"type": "commonjs",
1024
"exports": {
1125
".": {
1226
"types": "./dist/types/index.d.ts",
1327
"import": "./dist/src/index.mjs",
1428
"require": "./dist/src/index.js"
1529
}
1630
},
17-
"files": [
18-
"./dist/src",
19-
"./dist/types",
20-
"./src/"
21-
],
31+
"publishConfig": {
32+
"access": "public",
33+
"registry": "https://registry.npmjs.org"
34+
},
2235
"scripts": {
2336
"build": "rimraf dist && tsup && tsc -p ./tsconfig.declarations.json",
2437
"build:docs": "typedoc",
2538
"dev": "vitest",
2639
"test": "vitest run",
27-
"lint": "eslint src",
28-
"lint:fix": "eslint --fix src",
29-
"format": "prettier --check src test",
30-
"format:fix": "prettier --write src test",
40+
"lint": "oxlint",
41+
"lint:fix": "oxlint --fix",
42+
"format": "oxfmt --check",
43+
"format:fix": "oxfmt",
3144
"prepublishOnly": "pnpm build"
3245
},
33-
"publishConfig": {
34-
"access": "public",
35-
"registry": "https://registry.npmjs.org"
36-
},
37-
"license": "Apache-2.0",
38-
"repository": {
39-
"type": "git",
40-
"url": "git+https://github.com/solana-program/system.git"
41-
},
42-
"bugs": {
43-
"url": "https://github.com/solana-program/system/issues"
44-
},
45-
"homepage": "https://github.com/solana-program/system#readme",
46-
"peerDependencies": {
47-
"@solana/kit": "^6.4.0"
48-
},
4946
"devDependencies": {
50-
"@solana/eslint-config-solana": "^6.0.0",
47+
"@solana-config/oxc": "^0.1.1",
48+
"@solana/kit": "^6.4.0",
5149
"@solana/kit-plugin-litesvm": "^0.10.0",
5250
"@solana/kit-plugin-signer": "^0.10.0",
53-
"@solana/kit": "^6.4.0",
5451
"@types/node": "^24",
55-
"eslint": "^9.39.2",
56-
"prettier": "^3.7.4",
52+
"oxfmt": "^0.48.0",
53+
"oxlint": "^1.63.0",
54+
"oxlint-tsgolint": "^0.23.0",
5755
"rimraf": "^6.1.2",
5856
"tsup": "^8.1.2",
5957
"typedoc": "^0.28.15",
6058
"typescript": "^5.9.3",
6159
"vitest": "^4.0.15"
60+
},
61+
"peerDependencies": {
62+
"@solana/kit": "^6.4.0"
6263
}
6364
}

0 commit comments

Comments
 (0)