eslint-plugin-bun-compat
v0.2.0
Published
Detects and warns about Bun-specific code that is not compatible with Node.js
Downloads
5
Maintainers
Readme
eslint-plugin-bun-compat
Detects and warns about Bun-specific code that is not compatible with Node.js.
Usage
Installation
npm install -D eslint-plugin-bun-compatConfiguration
// eslint.config.js
import { defineConfig } from "eslint/config";
import bunCompat from "eslint-plugin-bun-compat";
export default defineConfig([
{ ...bunCompat.configs.recommended },
]);Rules
no-bun-imports
Warns about bun:* imports.
Options:
allowedModules(string[]): Allow specific Bun modules. Supports wildcards (bun:*).
// Example: Allow bun:test
"bun-compat/no-bun-imports": ["error", {
allowedModules: ["bun:test"]
}]no-bun-globals
Warns about Bun global APIs (Bun.* and $).
Options:
allowedGlobals(string[]): Allow specific Bun global APIs. Supports wildcards (Bun.*).
// Example: Allow Bun.env
"bun-compat/no-bun-globals": ["error", {
allowedGlobals: ["Bun.env", "Bun.version"]
}]Note: TypeScript type annotations are automatically allowed (e.g., let file: Bun.S3File).
