electron/docs/development
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
..
api-history-migration-guide.md chore: emphasize documentation style guide (#45639) 2025-03-06 17:17:06 +01:00
build-instructions-gn.md chore: use relative links from docs/ to files outside of docs/ (#49605) 2026-02-19 01:15:27 -08:00
build-instructions-linux.md docs: update linux build instructions (#49030) 2025-11-24 14:36:32 -05:00
build-instructions-macos.md docs: fix typos across documentation (#49734) 2026-02-11 12:45:46 +01:00
build-instructions-windows.md docs: update build prerequisites (#47680) 2025-07-09 12:07:24 +02:00
chromium-development.md chore: update https://cs.chromium.org/ links to https://source.chromium.org/ (#37190) 2023-02-11 18:52:32 -08:00
clang-tidy.md docs: fix typos in clang-tidy examples (#29327) 2021-05-27 09:45:37 +09:00
coding-style.md chore: use oxfmt and oxlint in 42-x-y (#51435) 2026-05-02 15:23:13 -07:00
creating-api.md chore: use relative links from docs/ to files outside of docs/ (#49605) 2026-02-19 01:15:27 -08:00
debugging-on-macos.md docs: update development-related documentation (#31043) 2021-10-27 10:18:38 +09:00
debugging-on-windows.md docs: fix typos across documentation (#49734) 2026-02-11 12:45:46 +01:00
debugging-with-symbol-server.md docs: update formatting for mdx3 compatibility (#42052) 2024-05-07 19:20:47 -04:00
debugging-with-xcode.md chore: disallow shortcut reference links in docs Markdown (#36860) 2023-01-16 10:22:49 +01:00
debugging.md chore: fix spelling errors in multiple files (#34574) 2022-06-16 16:46:11 +09:00
issues.md docs: update external links (#39421) 2023-08-10 11:55:52 +02:00
patches.md build: derive patches upstream-head ref from script path (42-x-y) (#50740) 2026-04-06 16:02:42 -04:00
pull-requests.md docs: point pull requests guide to build tools (#50198) 2026-03-13 16:01:41 -04:00
README.md test: drop now-empty remote runner (#35343) 2022-08-16 15:23:13 -04:00
reclient.md docs: add reclient docs, remove goma docs (#40948) 2024-01-12 13:50:20 +13:00
source-code-directory-structure.md chore: use relative links from docs/ to files outside of docs/ (#49605) 2026-02-19 01:15:27 -08:00
style-guide.md docs: add a few API history fragments (#49340) 2026-01-21 12:57:02 -05:00
testing.md docs: fix typos across documentation (#49734) 2026-02-11 12:45:46 +01:00
v8-development.md docs: tidy up links (#26292) 2020-11-02 18:58:14 +09:00

Developing Electron

These guides are intended for people working on the Electron project itself. For guides on Electron app development, see /docs/README.md.

Table of Contents

Getting Started

In order to contribute to Electron, the first thing you'll want to do is get the code.

Electron's build-tools automate much of the setup for compiling Electron from source with different configurations and build targets.

If you would prefer to build Electron manually, see the build instructions.

Once you've checked out and built the code, you may want to take a look around the source tree to get a better idea of what each directory is responsible for. The source code directory structure gives a good overview of the purpose of each directory.

Opening Issues on Electron

For any issue, there are generally three ways an individual can contribute:

  1. By opening the issue for discussion
  2. By helping to triage the issue
    • You can do this either by providing assistive details (a reproducible test case that demonstrates a bug) or by providing suggestions to address the issue.
  3. By helping to resolve the issue
    • This can be done by demonstrating that the issue is not a bug or is fixed; but more often, by opening a pull request that changes the source in electron/electron in a concrete and reviewable manner.

See issues for more information.

Making a Pull Request to Electron

Most pull requests opened against the electron/electron repository include changes to either the C/C++ code in the shell/ folder, the TypeScript code in the lib/ folder, the documentation in docs/, or tests in the spec/ folder.

See pull requests for more information.

If you want to add a new API module to Electron, you'll want to look in creating API.

Governance

Electron has a fully-fledged governance system that oversees activity in Electron and whose working groups are responsible for areas like APIs, releases, and upgrades to Electron's dependencies including Chromium and Node.js. Depending on how frequently and to what end you want to contribute, you may want to consider joining a working group.

Details about each group and their responsibilities can be found in the governance repo.

Patches in Electron

Electron is built on two major upstream projects: Chromium and Node.js. Each of these projects has several of their own dependencies, too. We try our best to use these dependencies exactly as they are but sometimes we can't achieve our goals without patching those upstream dependencies to fit our use cases.

As such, we maintain a collection of patches as part of our source tree. The process for adding or altering one of these patches to Electron's source tree via a pull request can be found in patches.

Debugging

There are many different approaches to debugging issues and bugs in Electron, many of which are platform specific.

For an overview of information related to debugging Electron itself (and not an app built with Electron), see debugging.