Skip to content

Commit 370d3a8

Browse files
authored
chore(tooling): migrate lint and formatting to oxlint and oxfmt (tldraw#8258)
Closes tldraw#7572. In order to remove slow dual-linting and simplify the toolchain, this PR fully migrates the repo from ESLint + Prettier to Oxlint + Oxfmt, with workspace lint scripts executing Oxlint from the repo root for consistent config resolution. This removes the ESLint config and in-repo ESLint plugin setup, adds an Oxlint JS plugin for tldraw-specific rules, switches formatter commands and config to Oxfmt, and updates package/workspace scripts and CI to use the new stack end-to-end. ### After: Oxlint: ~6s Oxfmt: ~162ms ### Before: Eslint: ~1min 15s Prettier: ~4s ### Change type - [x] `improvement` ### Test plan 1. Run `yarn lint` from repo root. 2. Run `yarn lint` from a workspace (for example `packages/tldraw` and `apps/dotcom/client`) and verify it passes. 3. Run `yarn check-packages` and verify lint script expectations pass. 4. Run `yarn format-current` and `yarn lint-current` on changed files. - [ ] Unit tests - [ ] End to end tests
1 parent 648503b commit 370d3a8

205 files changed

Lines changed: 2234 additions & 3635 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/checks.yml

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,6 @@ defaults:
1515
shell: bash
1616

1717
jobs:
18-
lint:
19-
name: 'Lint'
20-
timeout-minutes: 15
21-
runs-on: ubuntu-latest-16-cores-arm-open
22-
23-
steps:
24-
- name: Check out code
25-
uses: actions/checkout@v6
26-
27-
- uses: ./.github/actions/setup
28-
29-
- name: Lint
30-
run: yarn lint
31-
3218
test:
3319
name: 'Tests & checks'
3420
timeout-minutes: 15
@@ -58,13 +44,11 @@ jobs:
5844
path: |
5945
.lazy
6046
**/.lazy
61-
.eslintcache
6247
**/.tsbuild
6348
**/*.tsbuildinfo
64-
node_modules/.cache/prettier
65-
key: test-tools-${{ runner.os }}-${{ hashFiles('yarn.lock', 'eslint.config.mjs', 'lazy.config.ts') }}-${{ github.sha }}
49+
key: test-tools-${{ runner.os }}-${{ hashFiles('yarn.lock', '.oxlintrc.json', '.oxfmtrc.json', 'lazy.config.ts') }}-${{ github.sha }}
6650
restore-keys: |
67-
test-tools-${{ runner.os }}-${{ hashFiles('yarn.lock', 'eslint.config.mjs', 'lazy.config.ts') }}-
51+
test-tools-${{ runner.os }}-${{ hashFiles('yarn.lock', '.oxlintrc.json', '.oxfmtrc.json', 'lazy.config.ts') }}-
6852
6953
- name: Typecheck
7054
run: yarn build-types
@@ -80,6 +64,9 @@ jobs:
8064
- name: Check API declarations and docs work as intended
8165
run: yarn api-check
8266

67+
- name: Lint
68+
run: yarn lint
69+
8370
- name: Check dotcom localizations
8471
run: |
8572
yarn build-i18n

.oxfmtrc.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "./node_modules/oxfmt/configuration_schema.json",
3+
"trailingComma": "es5",
4+
"singleQuote": true,
5+
"semi": false,
6+
"printWidth": 100,
7+
"tabWidth": 2,
8+
"useTabs": true,
9+
"sortPackageJson": false
10+
}

0 commit comments

Comments
 (0)