Skip to content

Commit 9c3ef6a

Browse files
Merge pull request #863 from corbitsdev/cl-7376-migrate-corbits-code-from-prettier-and-eslint-to-oxfmt-and
Replace Prettier and ESLint with oxfmt and oxlint
2 parents 044fd6a + a5b9a95 commit 9c3ef6a

860 files changed

Lines changed: 36208 additions & 12353 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/ci.yml‎

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,9 @@ concurrency:
1111
cancel-in-progress: ${{ github.event_name != 'push' }}
1212

1313
jobs:
14-
# Prettier, eslint, and typecheck share one runner: one checkout and one
15-
# install instead of three of each. Prettier and eslint still run un-cached
16-
# in CI: restored result caches can mark files clean against a stale tool
17-
# version or config, masking real failures. The --cache flags in the
18-
# package.json lint script remain for local speed.
14+
# oxfmt, oxlint, and typecheck share one runner: one checkout and one
15+
# install instead of three of each. Dummy job names prettier and eslint
16+
# stay for protect-main.
1917
static-analysis:
2018
runs-on: ubuntu-latest
2119
steps:
@@ -39,11 +37,11 @@ jobs:
3937
- name: Install dependencies
4038
run: bun install --frozen-lockfile
4139

42-
- name: Prettier
43-
run: bunx prettier --check .
40+
- name: oxfmt
41+
run: bunx oxfmt --check .
4442

45-
- name: ESLint
46-
run: bunx eslint .
43+
- name: oxlint
44+
run: bunx oxlint .
4745

4846
- name: Typecheck
4947
run: bun run typecheck

‎.oxfmtrc.json‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"$schema": "./node_modules/oxfmt/configuration_schema.json",
3+
"trailingComma": "all",
4+
"tabWidth": 2,
5+
"useTabs": false,
6+
"semi": true,
7+
"singleQuote": false,
8+
"printWidth": 80,
9+
"sortPackageJson": false,
10+
"sortImports": false,
11+
"ignorePatterns": [
12+
"dist/**",
13+
"vendor/**",
14+
".worktrees/**",
15+
"scratch/**",
16+
"node_modules/**",
17+
"CHANGELOG.md",
18+
"tmp/**",
19+
".claude/**",
20+
".tmp/**",
21+
"plugins/corbits-skills/skills/opsh/SKILL.md",
22+
"plugins/corbits-skills/skills/refactor/SKILL.md",
23+
"plugins/corbits-skills/skills/scribe/SKILL.md",
24+
"plugins/corbits-skills/skills/ast-grep/SKILL.md",
25+
"plugins/corbits-skills/skills/review/SKILL.md",
26+
"plugins/corbits-skills/skills/create-issue/SKILL.md"
27+
]
28+
}

‎.oxlintrc.json‎

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
{
2+
"$schema": "./node_modules/oxlint/configuration_schema.json",
3+
// Type-aware rules (no-floating-promises, no-misused-promises,
4+
// no-unsafe-type-assertion) stay on tsc until oxlint can honor them.
5+
"plugins": ["eslint", "typescript"],
6+
"jsPlugins": ["./scripts/oxlint-plugin-corbits.js"],
7+
"categories": {
8+
"correctness": "error"
9+
},
10+
"ignorePatterns": [
11+
"dist/**",
12+
"vendor/**",
13+
".worktrees/**",
14+
"**/.worktrees/**",
15+
".scratch/**",
16+
"**/.scratch/**",
17+
"scratch/**",
18+
"**/scratch/**",
19+
"tmp/**",
20+
"**/tmp/**",
21+
".claude/**",
22+
"**/.claude/**",
23+
".tmp/**",
24+
"**/.tmp/**",
25+
"node_modules/**",
26+
"**/node_modules/**"
27+
],
28+
"options": {
29+
"reportUnusedDisableDirectives": "error"
30+
},
31+
"rules": {
32+
"no-console": "error",
33+
"no-unused-vars": [
34+
"error",
35+
{
36+
"args": "all",
37+
"argsIgnorePattern": "^_",
38+
"varsIgnorePattern": "^_",
39+
"caughtErrorsIgnorePattern": "^_"
40+
}
41+
],
42+
"no-unused-expressions": ["error", { "allowTaggedTemplates": true }],
43+
"typescript/adjacent-overload-signatures": "error",
44+
"typescript/array-type": "error",
45+
"typescript/ban-ts-comment": "error",
46+
"typescript/ban-tslint-comment": "error",
47+
"typescript/class-literal-property-style": "error",
48+
"typescript/consistent-generic-constructors": "error",
49+
"typescript/consistent-indexed-object-style": "error",
50+
"typescript/consistent-type-assertions": "error",
51+
"typescript/consistent-type-definitions": "off",
52+
"typescript/no-confusing-non-null-assertion": "error",
53+
"typescript/no-duplicate-enum-values": "error",
54+
"typescript/no-dynamic-delete": "error",
55+
"typescript/no-empty-interface": "error",
56+
"typescript/no-empty-object-type": "error",
57+
"typescript/no-explicit-any": "error",
58+
"typescript/no-extra-non-null-assertion": "error",
59+
"typescript/no-extraneous-class": "error",
60+
"typescript/no-inferrable-types": "error",
61+
"typescript/no-invalid-void-type": "error",
62+
"typescript/no-misused-new": "error",
63+
"typescript/no-namespace": "error",
64+
"typescript/no-non-null-asserted-nullish-coalescing": "error",
65+
"typescript/no-non-null-asserted-optional-chain": "error",
66+
"typescript/no-non-null-assertion": "error",
67+
"typescript/no-this-alias": "error",
68+
"typescript/no-unnecessary-type-constraint": "error",
69+
"typescript/no-unsafe-declaration-merging": "error",
70+
"typescript/no-unsafe-function-type": "error",
71+
"typescript/no-wrapper-object-types": "error",
72+
"typescript/prefer-as-const": "error",
73+
"typescript/prefer-for-of": "error",
74+
"typescript/prefer-function-type": "error",
75+
"typescript/prefer-literal-enum-member": "error",
76+
"typescript/prefer-namespace-keyword": "error",
77+
"typescript/unified-signatures": "error",
78+
"no-empty-function": "error"
79+
},
80+
"overrides": [
81+
{
82+
"files": ["src/util/control-char-strip.ts"],
83+
"rules": {
84+
"no-control-regex": "off"
85+
}
86+
},
87+
{
88+
"files": ["scripts/**"],
89+
"rules": {
90+
"no-console": "off"
91+
}
92+
},
93+
{
94+
"files": ["src/tui/smoke.ts", "src/tui/demo.ts"],
95+
"rules": {
96+
"no-console": "off"
97+
}
98+
},
99+
{
100+
"files": ["**/*.test.ts"],
101+
"rules": {
102+
"corbits/no-bare-mock-module": "error"
103+
}
104+
}
105+
]
106+
}

‎.prettierignore‎

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

‎.prettierrc.json‎

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

‎AGENTS.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ When refactoring replaces an old path, delete the old one. No back-compat shims,
3434
- Bug fixes start with a failing test that reproduces the bug. Do not start by patching.
3535
- `tests/unit/` shared unit tests and helpers · co-located `src/**/*.test.ts` for module logic · `tests/fixtures/` fixture repos · `tests/integration/` reactor/permission harness. Planned: `tests/e2e/` (fixture-repo runs).
3636
- A test must not depend on another file having run, or on the default file order. It must pass under `bun test ./src ./tests ./evals ./scripts --randomize`. If a test mutates module-level state or calls `mock.module`, it must restore that state itself (`afterEach`/`afterAll`), not rely on the process happening to reset it. When capturing a module's real exports to restore later, shallow-copy them (`{ ...moduleNamespace }`) at capture time, whether the namespace came from `await import(path)` or a static `import * as ns from "path"` — Bun mutates the live namespace object in place when the module is mocked, so holding a bare reference to it (either form) silently turns into the mocked exports.
37-
- Never call `mock.module` directly. Bun runs every test file in one process, so a `mock.module` call without its own teardown stays installed for the rest of the run and silently replaces the real module for other files — producing failures in files the change never touched, with no obvious link to the cause and no signal from `tsc` or a per-file run (CL-6967). Use `withMockedModule`/`withMockedModuleDuring` from `tests/helpers/mock-module.ts`, which capture the real module and register their own restore. An eslint rule (`no-restricted-syntax` in `eslint.config.js`) rejects bare `mock.module` calls in `*.test.ts` files.
38-
- A test earns its place only if a real behavior change can fail it. Document copy, brand colors, marketing assets, and splash text are not behavior: assertions that pin an asset's literal wording, an exact palette hex/ANSI value, or rendered copy fail on copy/design edits and catch no regressions — assert the contract instead (parsing, formatting, ranges, aliases, invariants). Tests are code too: pinning a source file's own text is the same trap. This bar is a review and authorship rule, not an eslint shape match.
37+
- Never call `mock.module` directly. Bun runs every test file in one process, so a `mock.module` call without its own teardown stays installed for the rest of the run and silently replaces the real module for other files — producing failures in files the change never touched, with no obvious link to the cause and no signal from `tsc` or a per-file run (CL-6967). Use `withMockedModule`/`withMockedModuleDuring` from `tests/helpers/mock-module.ts`, which capture the real module and register their own restore. The oxlint plugin (`corbits/no-bare-mock-module` in `.oxlintrc.json` / `scripts/oxlint-plugin-corbits.js`) rejects bare `mock.module` calls in `*.test.ts` files.
38+
- A test earns its place only if a real behavior change can fail it. Document copy, brand colors, marketing assets, and splash text are not behavior: assertions that pin an asset's literal wording, an exact palette hex/ANSI value, or rendered copy fail on copy/design edits and catch no regressions — assert the contract instead (parsing, formatting, ranges, aliases, invariants). Tests are code too: pinning a source file's own text is the same trap. This bar is a review and authorship rule, not a linter shape match.
3939

4040
## Build & Validation
4141

‎CHANGELOG.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ parallel copies under `docs/` or `scripts/notes/`. At cut time: rename
5959

6060
### Changed
6161

62+
- oxfmt formats the tree and oxlint is the lint gate. Prettier and ESLint are
63+
gone. Dummy CI job names `prettier` and `eslint` stay for protect-main.
64+
Empty functions and non-null assertions are errors.
65+
6266
- Skywalker may spawn one successor with a changed brief after a failed or
6367
incomplete-report fleet worker. A parent-initiated interrupt
6468
(`stop_reason: interrupted`) is a resumable pause — `resume_agent` or

0 commit comments

Comments
 (0)