fixhunt

biome nursery/useVueBaseImport: fix changes program behavior

fix-changes-behaviorlabelled safeprogram-bug · lowrelated
Findings / 2026-10-17T20-51-53-018Z-egr4-biome-nursery_useVueBaseImport / r2-p008biome 2.5.155 → 1 lines2026-10-17 20:51 UTC

Hypothesis Nemotron 3 Super predicted to fire fired 1×

sparse arrays, holes, Array(n) vs [n], array-likes

Program

before
1import { ref } from "@vue/reactivity";
after
1import { ref } from "vue";

Output

stdout beforeexit 1
(no stdout)
Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@vue/reactivity' imported from /w/prog.js
stdout afterexit 1
(no stdout)
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'vue' imported from /w/prog.js
fired
1 before · 0 after
runs
each version twice, same file name, no network

Judge Nemotron 3 Ultra advisory program-bug · low

Both the original and fixed programs fail with ERR_MODULE_NOT_FOUND because neither '@vue/reactivity' nor 'vue' is installed in the execution environment. The behavioral difference is solely due to the missing third-party packages, not the rewrite itself.

Explanation Nemotron 3 Super unverified

The original import path `@vue/reactivity` does not exist in the project’s dependency tree; replacing it with `vue` assumes that package provides the same exported symbol under a different module specifier. Since neither package is resolvable, both imports fail, but the error messages differ because they reference distinct module names—indicating the rewrite changed the module resolution target without establishing functional equivalence or ensuring the new path is valid, thus altering observable behavior (the specific module-not-found error).

Reproduce

file
prog.js (the before program)
minimized program
r2-p008.js
evidence sheet
r2-p008.md
regression fixture
r2-p008.js the minimized program with a header stating the observed change, for the tool's test suite
node prog.js
bunx @biomejs/biome lint --only=nursery/useVueBaseImport --write prog.js
node prog.js

Upstream search GitHub issues Tavily Nemotron 3 Super + Ultra

useVueBaseImport fix · nursery useVueBaseImport reactivity import · Biome Vue base import transformation · fix changes behavior vue module resolution

  • related biomejs/biome/pull/7597 PR #7597 fixes aliased paths in useImportExtensions, a different rule and mechanism than nursery/useVueBaseImport rewriting @vue/reactivity to vue
  • related biomejs/biome/pull/3274 PR #3274 adds importMapping options to useImportExtensions, same general area of import rewriting but different rule and construct

Details

program
Sparse arrays, holes, Array(n) vs [n], array-likes
hazard
sparse arrays, holes, Array(n) vs [n], array-likes
oracle
stderr before: Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@vue/reactivity' imported from /w/prog.js stderr after: Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'vue' imported from /w/prog.js
run
2026-10-17T20-51-53-018Z-egr4-biome-nursery_useVueBaseImport
generated program (5 lines) and the fix's diff
1import { ref } from "@vue/reactivity";
2const arr = new Array(3);
3arr[0] = ref(0);
4arr[2] = ref(2);
5console.log(arr.map((v, i) => v ? `has${i}` : `hole`));
--- orig.js	2026-10-17 16:52:54.142300776 -0400
+++ fixed.js	2026-10-17 16:52:54.424305524 -0400
@@ -1,4 +1,4 @@
-import { ref } from "@vue/reactivity";
+import { ref } from "vue";
 const arr = new Array(3);
 arr[0] = ref(0);
 arr[2] = ref(2);
rule documentation given to the models
Summary

- Name: useVueBaseImport
- Fix: safe
- Default severity: info
- Available from version: 2.5.13
- Diagnostic category: lint/nursery/useVueBaseImport

Domains

- Name: vue
- The rule is recommended for this domain
- The rule is enabled when one of these dependencies are detected:
  - vue@>=3.0.0


Description

 Enforce importing Vue's public entry point instead of internal Vue packages.

 The `@vue/runtime-dom`, `@vue/runtime-core`, `@vue/reactivity`, and `@vue/shared` packages are internal implementation packages. Their public exports should be imported from `vue` instead.

Examples

Invalid

 ```js,expect_diagnostic
 import { computed } from "@vue/reactivity";
 ```

 ```js,expect_diagnostic
 export * from "@vue/shared";
 ```

Valid

 ```js
 import { computed } from "vue";
 import { internalOnly } from "@vue/reactivity";
 ```