Skip to content

chore: replace custom ban-expect-assertions JS lint with builtin no-restricted-properties - #10933

Merged
shulaoda merged 2 commits into
rolldown:mainfrom
isker:fix/pre-commit-allocator-panic
Sep 23, 2026
Merged

shulaoda merged 2 commits into
rolldown:mainfrom
isker:fix/pre-commit-allocator-panic

Conversation

@isker

@isker isker commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Replace the custom rolldown-custom/ban-expect-assertions JS lint with a builtin rule no-restricted-properties. (This rule did not exist when the JS lint was introduced.) This allows rolldown's pre-commit hook to run in low-memory environments.

Specifically, Oxlint allocates 4GB of virtual memory per-thread in the presence of JS lints. Relevant code:
https://github.com/oxc-project/oxc/blob/12cb5473519327bd37780f2e42bf1eade98542b6/crates/oxc_allocator/src/pool/fixed_size.rs#L31-L38
https://github.com/oxc-project/oxc/blob/12cb5473519327bd37780f2e42bf1eade98542b6/crates/oxc_allocator/src/pool/fixed_size.rs#L377-L380
https://github.com/oxc-project/oxc/blob/12cb5473519327bd37780f2e42bf1eade98542b6/crates/oxc_allocator/src/fixed_size.rs#L19
https://github.com/oxc-project/oxc/blob/12cb5473519327bd37780f2e42bf1eade98542b6/crates/oxc_allocator/src/arena/fixed_size/unix.rs

If the environment cannot allocate 4GB, the pre-commit hook fails. I'm using such an environment to contribute to rolldown today. I understand that there can't be a guarantee of no JS lints (or other things that require more memory) in the future, but this particular one seems unnecessary and easy to replace. (Note that this new configuration is not strictly equivalent, because it fails on any usage of expect.assertions, not just calls as the current JS lint does. That being said, I think the distinction does not matter in this particular case.)

AI disclosure: this fix was generated by Amp. You can see details in the thread. I understand and take responsibility for the changes.

@isker
isker force-pushed the fix/pre-commit-allocator-panic branch from 31a65a6 to 7d7fe34 Compare September 21, 2026 02:28
@isker isker changed the title fix: avoid JS lint allocator in pre-commit hook fix: replace rolldown-custom/ban-expect-assertions with builtin no-restricted-properties Sep 21, 2026
@isker
isker marked this pull request as ready for review September 21, 2026 17:19
@shulaoda shulaoda self-assigned this Sep 23, 2026
@shulaoda shulaoda changed the title fix: replace rolldown-custom/ban-expect-assertions with builtin no-restricted-properties chore: replace custom ban-expect-assertions JS lint with builtin no-restricted-properties Sep 23, 2026

@shulaoda shulaoda left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!

@shulaoda
shulaoda merged commit ffb9395 into rolldown:main Sep 23, 2026
31 checks passed
@rolldown-guard rolldown-guard Bot mentioned this pull request Sep 23, 2026
shulaoda added a commit that referenced this pull request Sep 23, 2026
## [1.2.10] - 2026-09-23

### 🚀 Features

- rolldown_plugin_esm_external_require: prefer 'module.exports' over a namespace spread (#10901) by @isker
- watch: support directories in addWatchFile (#10944) by @shulaoda
- label code-splitting timing rows (#10896) by @IWANABETHATGUY
- separate code-splitting group timing rows (#10892) by @IWANABETHATGUY
- clarify callback owners in the timing report (#10890) by @IWANABETHATGUY
- add checks.bundlerTimings with deprecated pluginTimings alias (#10883) by @IWANABETHATGUY

### 🐛 Bug Fixes

- code-splitting: initialize leaves behind a re-exported namespace import (#10694) by @hyfdev
- node: record the WASI target on the WebContainer binding fallback (#10952) by @shulaoda
- dev: force incremental build on in DevEngine::new (#10958) by @o-alexandrov
- tree-shaking: propagate side effects through cycles (#10893) by @IWANABETHATGUY
- deconflict CJS locals that shadow a renamed require wrapper (#10793) by @logaretm
- include group indexes in labeled `codeSplitting` timing rows (#10916) by @IWANABETHATGUY
- docs: type-check Algolia `indices` option (#10934) by @shulaoda
- docs: restore Algolia search (#10929) by @isker
- tell code-splitting timing rows apart by position (#10903) by @IWANABETHATGUY

### 🚜 Refactor

- rolldown_fs_watcher: remove the single-path API (#10950) by @shulaoda
- dev: register watch files through FsWatcher (#10949) by @shulaoda
- watch: let FsWatcher own the watched paths (#10948) by @shulaoda
- watch: identify watch files by normalized absolute path (#10943) by @shulaoda
- plugin: build a plugin-resolved `ResolvedId` in one place (#10921) by @IWANABETHATGUY

### 📚 Documentation

- dev: add HMR design, align dev docs and engine comments (#10271) by @h-a-n-a

### ⚡ Performance

- batch `sourcemapPathTransform` calls (#10763) by @IWANABETHATGUY
- batch `sourcemapIgnoreList` calls (#10762) by @IWANABETHATGUY
- hmr: drop the unused kind argument from registerFactory (#10915) by @h-a-n-a

### 🧪 Testing

- handle Windows paths in sourcemap callback tests (#10942) by @IWANABETHATGUY

### ⚙️ Miscellaneous Tasks

- replace custom `ban-expect-assertions` JS lint with builtin `no-restricted-properties` (#10933) by @isker
- deps: update napi (#10959) by @renovate[bot]
- deps: upgrade oxc to 0.151.0 (#10939) by @camc314
- deps: update test262 submodule for tests (#10941) by @rolldown-guard[bot]
- deps: update npm packages (#10931) by @renovate[bot]
- deps: update napi (#10928) by @renovate[bot]
- deps: update dependency vite-plus to v0.3.3 (#10914) by @renovate[bot]
- deps: update rust crates (#10932) by @renovate[bot]
- deps: update github actions (#10930) by @renovate[bot]
- deps: update dependency rolldown-plugin-dts to v0.28.6 (#10924) by @renovate[bot]
- deps: update crate-ci/typos action to v1.50.2 (#10917) by @renovate[bot]
- deps: update dependency @napi-rs/cli to v3.10.4 (#10913) by @renovate[bot]
- deps: update napi (#10897) by @renovate[bot]

### ❤️ New Contributors

* @o-alexandrov made their first contribution in [#10958](#10958)

Co-authored-by: shulaoda <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants