From 649b7e0467c25d2d9c7ac2067b9ad6ae9c5d0ed0 Mon Sep 17 00:00:00 2001 From: Clankmaxxing Clod <287268959+clankmaxxing-clod@users.noreply.github.com> Date: Wed, 22 Jul 2026 20:02:01 +0000 Subject: [PATCH] Convert clients/js-legacy to oxlint and oxfmt Replace ESLint + Prettier with oxlint and oxfmt for the js-legacy client. - package.json: swap eslint/prettier/typescript-eslint devDependencies for oxlint and oxfmt; repoint lint/lint:fix/format/format:fix scripts; drop the "prettier" config key. - Add .oxlintrc.json mirroring the previous ESLint config: correctness rules as errors, consistent-type-imports enforced, ban-ts-comment / no-explicit-any / no-unused-vars / no-empty-object-type disabled, and import/extensions (via the import plugin) replacing eslint-plugin-require-extensions, still disabled for test/examples. - Add .oxfmtrc.json migrated from @solana/prettier-config-solana (printWidth 120, tabWidth 4, single quotes, semicolons, avoid arrow parens). - Remove .eslintrc and .eslintignore. The Makefile CI targets call `pnpm lint` / `pnpm format`, so no workflow changes are needed. Verified: lint, format --check, build, and tests all pass; existing source is already oxfmt-clean (no reformatting). Co-Authored-By: Claude Opus 4.8 (1M context) --- clients/js-legacy/.eslintignore | 5 ----- clients/js-legacy/.eslintrc | 34 -------------------------------- clients/js-legacy/.oxfmtrc.json | 14 +++++++++++++ clients/js-legacy/.oxlintrc.json | 25 +++++++++++++++++++++++ clients/js-legacy/package.json | 21 +++++++------------- 5 files changed, 46 insertions(+), 53 deletions(-) delete mode 100644 clients/js-legacy/.eslintignore delete mode 100644 clients/js-legacy/.eslintrc create mode 100644 clients/js-legacy/.oxfmtrc.json create mode 100644 clients/js-legacy/.oxlintrc.json diff --git a/clients/js-legacy/.eslintignore b/clients/js-legacy/.eslintignore deleted file mode 100644 index 6da325e..0000000 --- a/clients/js-legacy/.eslintignore +++ /dev/null @@ -1,5 +0,0 @@ -docs -lib -test-ledger - -package-lock.json diff --git a/clients/js-legacy/.eslintrc b/clients/js-legacy/.eslintrc deleted file mode 100644 index 5aef10a..0000000 --- a/clients/js-legacy/.eslintrc +++ /dev/null @@ -1,34 +0,0 @@ -{ - "root": true, - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/recommended", - "plugin:prettier/recommended", - "plugin:require-extensions/recommended" - ], - "parser": "@typescript-eslint/parser", - "plugins": [ - "@typescript-eslint", - "prettier", - "require-extensions" - ], - "rules": { - "@typescript-eslint/ban-ts-comment": "off", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-unused-vars": "off", - "@typescript-eslint/no-empty-interface": "off", - "@typescript-eslint/consistent-type-imports": "error" - }, - "overrides": [ - { - "files": [ - "examples/**/*", - "test/**/*" - ], - "rules": { - "require-extensions/require-extensions": "off", - "require-extensions/require-index": "off" - } - } - ] -} diff --git a/clients/js-legacy/.oxfmtrc.json b/clients/js-legacy/.oxfmtrc.json new file mode 100644 index 0000000..6c7b2db --- /dev/null +++ b/clients/js-legacy/.oxfmtrc.json @@ -0,0 +1,14 @@ +{ + "arrowParens": "avoid", + "bracketSameLine": false, + "bracketSpacing": true, + "jsxSingleQuote": false, + "printWidth": 120, + "quoteProps": "as-needed", + "semi": true, + "singleQuote": true, + "tabWidth": 4, + "useTabs": false, + "sortPackageJson": false, + "ignorePatterns": [] +} diff --git a/clients/js-legacy/.oxlintrc.json b/clients/js-legacy/.oxlintrc.json new file mode 100644 index 0000000..0750047 --- /dev/null +++ b/clients/js-legacy/.oxlintrc.json @@ -0,0 +1,25 @@ +{ + "$schema": "./node_modules/oxlint/configuration_schema.json", + "plugins": ["typescript", "unicorn", "oxc", "import"], + "categories": { + "correctness": "error" + }, + "rules": { + "typescript/ban-ts-comment": "off", + "typescript/no-explicit-any": "off", + "typescript/no-unused-vars": "off", + "no-unused-vars": "off", + "typescript/no-empty-object-type": "off", + "typescript/consistent-type-imports": "error", + "import/extensions": ["error", "ignorePackages"] + }, + "ignorePatterns": ["dist", "docs", "lib", "test-ledger"], + "overrides": [ + { + "files": ["examples/**/*", "test/**/*"], + "rules": { + "import/extensions": "off" + } + } + ] +} diff --git a/clients/js-legacy/package.json b/clients/js-legacy/package.json index 63382bf..d782979 100644 --- a/clients/js-legacy/package.json +++ b/clients/js-legacy/package.json @@ -34,10 +34,10 @@ "deploy": "npm run deploy:docs", "deploy:docs": "npm run docs && gh-pages --dest token-group/js --dist docs --dotfiles", "docs": "shx rm -rf docs && typedoc && shx cp .nojekyll docs/", - "lint": "eslint --max-warnings 0 .", - "lint:fix": "eslint --fix .", - "format": "prettier --check src test", - "format:fix": "prettier --write src test", + "lint": "oxlint --max-warnings 0", + "lint:fix": "oxlint --fix", + "format": "oxfmt --check src test", + "format:fix": "oxfmt --write src test", "nuke": "shx rm -rf node_modules package-lock.json || true", "postbuild": "shx echo '{ \"type\": \"commonjs\" }' > dist/cjs/package.json", "reinstall": "npm run nuke && npm install", @@ -52,27 +52,20 @@ "@solana/codecs": "7.0.0" }, "devDependencies": { - "@solana/prettier-config-solana": "0.0.7", "@solana/spl-type-length-value": "0.2.0", "@solana/web3.js": "^1.95.5", "@types/chai": "^5.0.1", "@types/mocha": "^10.0.10", "@types/node": "^26.0.0", - "@typescript-eslint/eslint-plugin": "^8.4.0", - "@typescript-eslint/parser": "^8.4.0", "chai": "^6.2.2", - "eslint": "^8.57.0", - "eslint-config-prettier": "^10.0.1", - "eslint-plugin-prettier": "^5.2.1", - "eslint-plugin-require-extensions": "^0.1.1", "gh-pages": "^6.2.0", "mocha": "^11.0.1", - "prettier": "^3.4.2", + "oxfmt": "^0.60.0", + "oxlint": "^1.75.0", "shx": "^0.4.0", "ts-node": "^10.9.2", "tslib": "^2.8.1", "typedoc": "^0.28.19", "typescript": "^6.0.3" - }, - "prettier": "@solana/prettier-config-solana" + } }