electron/script
Charles Kerr 673351b6a1
chore: use oxfmt and oxlint in 42-x-y (#51435)
* build: replace eslint with oxlint and add oxfmt

Replace ESLint and its plugin ecosystem with oxlint (oxc.rs).
Add oxfmt alongside oxlint for JS/TS formatting and import sorting.

- Consolidate root .eslintrc.json plus 13 nested configs into .oxlintrc.json
- script/lint.js spawns oxlint binary directly instead of ESLint Node API
- Per-process no-restricted-imports rules preserved as oxlintrc overrides
- mocha/no-exclusive-tests replaced by in-repo plugin (no-only-tests.mjs)
- docs ESLint pass replaced by inline node: protocol check in lint.js
- .oxfmtrc.json matching repo style (single quotes, semicolons, 2-space)
- yarn lint:fmt (oxfmt --check) chained into yarn lint
- yarn format (oxfmt --write) for local fixup
- lint-staged runs oxfmt --write on staged JS/TS files

This commit contains only rule/tooling infrastructure changes and is
intended to be cherry-picked to other maintenance branches, where
formatting and lint fixes can be applied separately.

Manual backport of electron/electron@e1af67c698 (#50691) and
electron/electron@3c7fd34f47 (#50692).

* chore: apply oxfmt formatting and oxlint fixes

One-time application of the new linting and formatting rules to the
42-x-y codebase:

- yarn format (oxfmt --write) over all JS/TS sources
- oxlint --fix to restore curly braces where oxfmt removed them
- Prefix unused parameters with _ (no-unused-vars)
- Add eslint-disable-next-line comments for intentional patterns:
  - prefer-promise-reject-errors in desktop-capturer.ts
  - no-throw-literal in preload.ts

Pure formatting and lint suppression; no behavioral changes.
2026-05-02 15:23:13 -07:00
..
actions ci: run BrowserWindow test spec on Wayland (#50658) 2026-04-03 10:25:48 -05:00
codesign chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
lib chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
lint-plugins chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
node fix: pass root_gen_dir from GN to generate_node_headers.py (#50872) 2026-04-10 12:15:08 +02:00
release chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
zip_manifests fix: enable shader-f16 on windows (#48342) 2025-10-14 15:46:12 +02:00
apply_all_patches.py chore: bump pylint to 2.17 (#41576) 2024-03-21 09:48:23 -04:00
build-stats.mjs chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
check-patch-diff.ts chore: bump chromium to 121.0.6104.0 (main) (#40418) 2023-11-03 15:37:55 -04:00
check-symlinks.js refactor: use node scheme imports in scripts (#38846) 2023-06-22 16:21:42 +02:00
copy-pipeline-segment-publish.js chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
cp.mjs build: drop shx dependency (#47293) 2025-05-30 10:59:11 +02:00
create-api-json.mjs chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
dbus_mock.py fix: linux test shutdown error "AttributeError: type object 'DBusTestCase' has no attribute 'stop_dbus'" (#51149) 2026-04-19 00:52:58 -07:00
doc-only-change.js chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
export_all_patches.py chore: bump pylint to 2.17 (#41576) 2024-03-21 09:48:23 -04:00
gen-filenames.ts chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
gen-hunspell-filenames.js chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
gen-libc++-filenames.js chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
generate-config-gypi.py build: fix python warnings "SyntaxWarning: invalid escape sequence '\w'" (#44650) 2024-11-14 12:27:20 +01:00
generate-deps-hash.js build: use github actions for windows (#44136) 2024-12-12 11:51:24 -05:00
generate-mas-config.py build: make is_mas_build a generated header instead of config (#43737) 2024-09-17 01:38:56 -07:00
generate-version-json.js chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
generate-zip-manifest.py chore: bump pylint to 2.17 (#41576) 2024-03-21 09:48:23 -04:00
get-git-ref-paths.py build: resolve electron_version from git when building in a worktree (#51166) 2026-04-20 08:24:33 -05:00
get-git-version.py fix: only remove the 'v' prefix from the git tag name (#45132) 2025-01-13 22:36:03 -05:00
git-export-patches build: export matching patches (#41174) 2024-02-08 13:47:59 -05:00
git-import-patches build: explicitly run scripts with python3 (#33720) 2022-04-12 13:21:55 +02:00
gn-asar-hash.js build: add import/order eslint rule (#44085) 2024-10-02 19:10:44 -07:00
gn-asar.js chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
gn-check.js build: don't use //third_party/depot_tools in gn build scripts (#50922) 2026-04-11 09:46:52 +02:00
gn-plist-but-with-hashes.js chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
lint-roller-chromium-changes.mjs chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
lint.js chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
nan-spec-runner.js chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
node-disabled-tests.json chore: bump node to v24.14.0 (main) (#49941) 2026-02-26 10:32:14 -05:00
node-spec-runner.js chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
patch-up.js chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
patches-mtime-cache.py chore: bump pylint to 2.17 (#41576) 2024-03-21 09:48:23 -04:00
patches-stats.mjs chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
qemu-init.sh ci: test linux 64k (#50358) 2026-03-19 09:31:47 -04:00
run-clang-format.py build: fix clang-format duplicate message (#45235) 2025-01-20 11:05:40 +01:00
run-clang-tidy.ts chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
run-if-exists.js chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
run-qemu-64k.sh ci: test linux 64k (#50358) 2026-03-19 09:31:47 -04:00
spec-runner.js chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
split-tests.js test: run visibility-state-spec.ts first (#44206) 2024-10-14 09:40:22 -04:00
start.js fix: remove killed check to allow multiple signals (#40667) 2025-10-23 15:20:04 -04:00
sysroots.json build: roll sysroots (#49844) 2026-02-18 13:24:29 -05:00
tar.py chore: bump pylint to 2.17 (#41576) 2024-03-21 09:48:23 -04:00
verify-chromedriver.py chore: bump pylint to 2.17 (#41576) 2024-03-21 09:48:23 -04:00
verify-ffmpeg.py chore: bump pylint to 2.17 (#41576) 2024-03-21 09:48:23 -04:00
verify-mksnapshot.py chore: bump pylint to 2.17 (#41576) 2024-03-21 09:48:23 -04:00
wayland-test-allowlist.txt ci: run BrowserWindow test spec on Wayland (#50658) 2026-04-03 10:25:48 -05:00
yarn.js build: upgrade yarn to 4.12.0 (#49176) 2025-12-10 14:04:14 -05:00
zip-symbols.py build: apply additional compression to dsym on upload (#48930) 2025-11-13 10:43:53 +01:00