From 7d89a3d4eab852c2c2336dadd38286645827b69f Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Tue, 24 Oct 2023 14:01:37 +0700 Subject: [PATCH] Ban `Buffer` in favor of `Uint8Array` --- index.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/index.js b/index.js index 0282491..fe79b0c 100644 --- a/index.js +++ b/index.js @@ -222,6 +222,10 @@ module.exports = { 'no-restricted-globals': [ 'error', 'event', + { + name: 'Buffer', + message: 'Use Uint8Array instead. See: https://sindresorhus.com/blog/goodbye-nodejs-buffer', + }, ], 'no-shadow-restricted-names': 'error', 'no-undef-init': 'error', @@ -252,6 +256,14 @@ module.exports = { 'sys', 'querystring', 'colors', + { + name: 'buffer', + message: 'Use Uint8Array instead. See: https://sindresorhus.com/blog/goodbye-nodejs-buffer', + }, + { + name: 'node:buffer', + message: 'Use Uint8Array instead. See: https://sindresorhus.com/blog/goodbye-nodejs-buffer', + }, ], 'array-bracket-newline': [ 'error',