test(linter/plugins): debug build for tests#15921
Merged
graphite-app[bot] merged 1 commit intomainfrom Nov 21, 2025
Merged
Conversation
This was referenced Nov 20, 2025
Member
Author
This was referenced Nov 20, 2025
29 tasks
camc314
reviewed
Nov 21, 2025
76a18b5 to
1d4a1b0
Compare
8b6108a to
690abec
Compare
1d4a1b0 to
2a97c99
Compare
2a97c99 to
e3b26e6
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a dual-build system for oxlint's JavaScript/TypeScript code, generating both release and debug builds. The debug build enables runtime assertions through a DEBUG global constant, while the release build optimizes away debug-only code.
Key changes:
- Debug builds generated alongside release builds with
DEBUG: 'true'defined, enabling runtime checks inassertIsNonNulland similar functions - Tests configured to run against debug builds to catch assertion failures during development
- Build infrastructure updated to output debug builds to a separate
/debugdirectory (excluded from NPM packages)
Reviewed Changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
apps/oxlint/tsdown.config.ts |
Configures tsdown to generate both release (dist) and debug builds with different DEBUG constant values |
apps/oxlint/vitest.config.ts |
Adds DEBUG define for test files (though tests run against pre-built debug code) |
apps/oxlint/test/e2e.test.ts |
Updates CLI path to use debug build instead of release build |
apps/oxlint/src-js/plugins/utils.ts |
Implements runtime null check in assertIsNonNull when DEBUG is true |
apps/oxlint/src-js/globals.d.ts |
Declares DEBUG as a global boolean constant defined at build time |
apps/oxlint/scripts/build.ts |
Copies native .node files to both dist and debug directories |
apps/oxlint/package.json |
Updates #oxlint import alias to point to debug build for test fixtures |
apps/oxlint/.gitignore |
Excludes /debug directory from version control |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
e3b26e6 to
33ade07
Compare
Contributor
Merge activity
|
Generate a debug build, in addition to the normal release build. In the debug build, `DEBUG` global is defined as `true` and `assertIsNonNull` does a runtime assertion. In release build, `DEBUG === false` and minifier removes debug-only code. Run the tests in debug mode. Debug build is generated in a separate directory from `dist`, so is *not* included in NPM package.
33ade07 to
325af32
Compare
Copilot AI
pushed a commit
that referenced
this pull request
Nov 21, 2025
Generate a debug build, in addition to the normal release build. In the debug build, `DEBUG` global is defined as `true` and `assertIsNonNull` does a runtime assertion. In release build, `DEBUG === false` and minifier removes debug-only code. Run the tests in debug mode. Debug build is generated in a separate directory from `dist`, so is *not* included in NPM package.
graphite-app bot
pushed a commit
that referenced
this pull request
Nov 23, 2025
#15949) #15921 added a debug build for Oxlint, and various PRs since have tweaked it. However, I now realize there's little point in generating *both* a release build and debug build. Just create one build, and use env var `DEBUG` to control whether it has debug assertions included in it or not. `pnpm run build` produces release build with no debug assertions, `pnpm run build-test` includes the asserts. I've verified that both do what they're meant to.
taearls
pushed a commit
to taearls/oxc
that referenced
this pull request
Dec 11, 2025
Generate a debug build, in addition to the normal release build. In the debug build, `DEBUG` global is defined as `true` and `assertIsNonNull` does a runtime assertion. In release build, `DEBUG === false` and minifier removes debug-only code. Run the tests in debug mode. Debug build is generated in a separate directory from `dist`, so is *not* included in NPM package.
taearls
pushed a commit
to taearls/oxc
that referenced
this pull request
Dec 11, 2025
oxc-project#15949) oxc-project#15921 added a debug build for Oxlint, and various PRs since have tweaked it. However, I now realize there's little point in generating *both* a release build and debug build. Just create one build, and use env var `DEBUG` to control whether it has debug assertions included in it or not. `pnpm run build` produces release build with no debug assertions, `pnpm run build-test` includes the asserts. I've verified that both do what they're meant to.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Generate a debug build, in addition to the normal release build.
In the debug build,
DEBUGglobal is defined astrueandassertIsNonNulldoes a runtime assertion. In release build,DEBUG === falseand minifier removes debug-only code.Run the tests in debug mode.
Debug build is generated in a separate directory from
dist, so is not included in NPM package.