🔧 Replace ESLint and Prettier with oxlint and oxfmt

- Drop .eslintrc.cjs and .prettierrc, add .oxlintrc.json and .oxfmtrc.json
- oxlint covers correctness/suspicious/perf/style/restriction categories
  plus import and typescript plugins; oxfmt reads the same .prettierrc-style
  options we had before
- Update lefthook.yml pre-commit jobs to run oxlint/oxfmt instead of
  eslint/prettier
- Update .vscode/extensions.json (oxc replaces eslint/prettier/vitest) and
  settings.json (oxc becomes the default formatter for TS/JS)
- Add 'oxlint', 'oxfmt', 'oxc', 'nodenext' to cspell dictionary
- Rewrite README 'Development' section to describe the new toolchain
This commit is contained in:
tmu committed 2026-09-03 10:25:47 +00:00
1 parent 3530262261
commit 078a8c30fd
11 files changed
+130 -130

No files matched your search

+21 -45
View File
@@ -1,45 +1,21 @@
# EXAMPLE USAGE:
#
# Refer for explanation to following link:
# https://lefthook.dev/configuration/
#
# pre-push:
# jobs:
# - name: packages audit
# tags:
# - frontend
# - security
# run: yarn audit
#
# - name: gems audit
# tags:
# - backend
# - security
# run: bundle audit
#
# pre-commit:
# parallel: true
# jobs:
# - run: yarn eslint {staged_files}
# glob: "*.{js,ts,jsx,tsx}"
#
# - name: rubocop
# glob: "*.rb"
# exclude:
# - config/application.rb
# - config/routes.rb
# run: bundle exec rubocop --force-exclusion {all_files}
#
# - name: govet
# files: git ls-files -m
# glob: "*.go"
# run: go vet {files}
#
# - script: "hello.js"
# runner: node
#
# - script: "hello.go"
# runner: go run
pre-commit:
parallel: true
jobs:
- name: oxlint
glob: "*.{ts,tsx,js,jsx,mjs,cjs}"
run: npx oxlint {staged_files}
- name: oxfmt
glob: "*.{ts,tsx,js,jsx,mjs,cjs}"
run: npx oxfmt --check {staged_files}
- name: cspell
run: npx cspell {staged_files}
- name: sort-package-json
run: npx sort-package-json --check
- name: typecheck
run: npx tsc --noEmit
- name: outdated
run: npx check-outdated
commands:
typecheck:
run: npm run check:tsc
@@ -48,8 +24,8 @@ commands:
sort:
run: npm run check:package
lint:
run: npm run check:eslint
run: npm run check:oxlint
format:
run: npm run check:prettier
run: npm run check:oxfmt
outdated:
run: npm run check:outdated
run: npm run check:outdated