Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
"electrum",
"electrumx",
"equalverify",
"eslintignore",
"esnext",
"ethereum",
"ethereum's",
Expand Down
7 changes: 0 additions & 7 deletions .eslintignore

This file was deleted.

50 changes: 0 additions & 50 deletions .eslintrc.cjs

This file was deleted.

2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Mechanical reformat with oxfmt
7e77c2a9f495589a194d24d50ba623879d2a48fa
3 changes: 3 additions & 0 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ jobs:
- name: Run linter
run: pnpm lint

- name: Check formatting
run: pnpm format:check

- name: Run spellchecker
run: pnpm spellcheck

Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ typings/
# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

Expand Down
15 changes: 15 additions & 0 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"printWidth": 125,
"singleQuote": true,
"trailingComma": "all",
"ignorePatterns": [
"**/dist/**",
"**/grammar/**",
"**/fixture/**",
"**/fixtures/**",
"**/import-fixtures/**",
"**/fixtures.ts",
"**/*.fixture.ts"
]
}
31 changes: 31 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["typescript", "import"],
"categories": {
"correctness": "off"
},
"ignorePatterns": [
"**/dist/**",
"**/node_modules/**",
"**/grammar/**",
"website/**",
"examples/webapp/**",
"**/*.js",
"**/*.cjs"
],
"rules": {
"default-param-last": "error",
"no-array-constructor": "error",
"no-dupe-class-members": "error",
"no-empty-function": ["error", { "allow": ["arrowFunctions", "functions", "methods"] }],
"no-loop-func": "error",
"no-loss-of-precision": "error",
"no-shadow": "error",
"no-throw-literal": "error",
"no-unused-expressions": ["error", { "allowShortCircuit": true }],
"no-useless-constructor": "error",
"no-unused-vars": ["error", { "argsIgnorePattern": "^_", "caughtErrors": "none" }],
"import/extensions": ["error", "ignorePackages"],
"typescript/explicit-function-return-type": ["error", { "allowExpressions": true }]
}
}
8 changes: 6 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@ pnpm test -t 'test name from it/describe block'
# Run a single test file directly
pnpm vitest run packages/utils/test/source-map.test.ts

# Lint all packages
# Lint all packages (uses oxlint)
pnpm lint

# Format all packages (uses oxfmt), or only check formatting
pnpm format
pnpm format:check

# Spellcheck
pnpm spellcheck

Expand Down Expand Up @@ -89,7 +93,7 @@ Shared between compiler and SDK:
## Code Conventions

- **ESM modules** — all packages use ES modules; file extensions required in imports (e.g., `./foo.js`)
- **Max line length**: 125 characters (strings and template literals exempt)
- **Formatting** is handled by oxfmt (`pnpm format`): 125 character print width, single quotes, trailing commas
- **Explicit return types** on functions (expressions exempt)
- **Keep nested code to a minimum** — use helper functions to keep code DRY and readable
- Prefer writing code in a way that reads top-down, from the main entry point to the leaves.
3 changes: 1 addition & 2 deletions examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@
"author": "Rosco Kalis <rosco@bitcoin.com>",
"license": "MIT",
"scripts": {
"lint": "eslint . --ext .ts --ignore-path ../.eslintignore"
"lint": "oxlint -c ../.oxlintrc.json"
},
"dependencies": {
"@bitauth/libauth": "^3.1.0-next.8",
"@cashscript/utils": "workspace:^",
"@types/node": "^24.13.3",
"cashc": "workspace:^",
"cashscript": "workspace:^",
"eslint": "^8.56.0",
"typescript": "^5.9.2"
}
}
2 changes: 1 addition & 1 deletion examples/testing-suite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"scripts": {
"compile": "tsx tasks/compile.ts",
"lint": "eslint . --ext .ts --ignore-path ../../.eslintignore",
"lint": "oxlint -c ../../.oxlintrc.json",
"test": "vitest run"
},
"dependencies": {
Expand Down
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,9 @@
"packageManager": "pnpm@12.25.1",
"devDependencies": {
"@types/node": "^24",
"@typescript-eslint/eslint-plugin": "^7.0.0",
"@typescript-eslint/parser": "^7.0.0",
"cspell": "^10.0.1",
"eslint": "^8.54.0",
"eslint-config-airbnb-typescript": "^18.0.0",
"eslint-plugin-import": "^2.31.0",
"oxfmt": "0.81.0",
"oxlint": "1.96.0",
"tsx": "^4.23.12",
"typescript": "^5.9.2",
"vite": "^8.3.0",
Expand All @@ -19,6 +16,8 @@
"scripts": {
"test": "pnpm -r --filter './packages/*' run test",
"lint": "pnpm -r --filter './packages/*' run lint",
"format": "oxfmt \"packages/*/*.ts\" \"packages/*/src/**/*.ts\" \"packages/*/test/**/*.ts\"",
"format:check": "oxfmt --check \"packages/*/*.ts\" \"packages/*/src/**/*.ts\" \"packages/*/test/**/*.ts\"",
"examples": "tsx examples/p2pkh.ts && tsx examples/transfer_with_timeout.ts && tsx examples/hodl_vault.ts",
"postinstall": "pnpm build",
"spellcheck": "cspell lint '**' --no-progress --must-find-files",
Expand Down
4 changes: 1 addition & 3 deletions packages/cashc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"build": "pnpm clean && pnpm compile",
"clean": "rm -rf ./dist",
"compile": "tsc -p tsconfig.build.json",
"lint": "eslint . --ext .ts --ignore-path ../../.eslintignore",
"lint": "oxlint -c ../../.oxlintrc.json",
"prepack": "pnpm build",
"prepublishOnly": "pnpm test && pnpm lint",
"test": "vitest run"
Expand All @@ -57,8 +57,6 @@
"@types/node": "^24.13.3",
"@types/semver": "^7.8.0",
"@vitest/coverage-v8": "^5.0.1",
"eslint": "^8.54.0",
"eslint-plugin-import": "^2.31.0",
"tsx": "^4.23.12",
"typescript": "^5.9.2",
"vitest": "^5.0.1"
Expand Down
Loading
Loading