forked from mysticatea/eslint-plugin-node
-
-
Notifications
You must be signed in to change notification settings - Fork 54
Open
Description
Rule details
import test from "bun:test";The rule no-missing-import reports that it can't resolve 'bun:test'.
If I add this option:
"n/no-missing-import": ["error", {
allowModules: ["bun:test"],
}],I get the error:
Error: Key "rules": Key "n/no-missing-import":
Value "bun:test" should match pattern "^(?:virtual:)?(?:@[a-zA-Z0-9_-.]+/)?[a-zA-Z0-9_-.]+$".
What type of rule is this?
Suggests an alternate way of doing something
Example code
-
index.jsimport test from "bun:test";
-
package.json{ "name": "testcase", "version": "1.0.0", "type": "module", "dependencies": { "eslint": "9.39.2", "eslint-plugin-n": "17.23.1" } } -
eslint.config.jsimport n from "eslint-plugin-n"; export default [{ plugins: { n }, rules: { "n/no-missing-import": ["error", { allowModules: ["bun:test"], }], }, }];
Participation
- I am willing to submit a pull request to implement this rule.
Additional comments
I disabled this rule to avoid false positives. But I would like to enable it to always check Node modules imported into files executed in the Bun runtime.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels