prefer-global/buffer
UnreleasedConfiguration
rslint.config.ts
Enforces consistent use of the global Buffer or the Buffer export from the Node.js buffer module.
Options
"always"(default) requires the globalBuffer."never"requires the module export instead of the globalBuffer.
The rule recognizes buffer and node:buffer, including CommonJS, ES module imports and process.getBuiltinModule(). It follows aliases and destructuring and respects local bindings that shadow globals. It does not provide automatic fixes or suggestions.
Examples
With "always", these uses are incorrect:
Use the global instead:
With "never", the global use above is incorrect. Import Buffer instead: