From 795d6c43f8bb600d895c638969f41a2dbd16aa2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C5=ABdolfs=20O=C5=A1i=C5=86=C5=A1?= Date: Thu, 25 Aug 2022 15:14:18 +0200 Subject: [PATCH] Require `let` or `const` instead of var MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rūdolfs Ošiņš --- .eslintrc.json | 5 ++++- src/polyfills/typedarray-to-buffer.js | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 40c12b02e..9ebfebe8f 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -106,7 +106,10 @@ "prefer-const": "error", // Disallow modifying variables that are declared using const. // https://eslint.org/docs/rules/no-const-assign - "no-const-assign": "error" + "no-const-assign": "error", + // Require let or const instead of var. + // https://eslint.org/docs/rules/no-var + "no-var": "error" }, "settings": { "svelte3/typescript": true diff --git a/src/polyfills/typedarray-to-buffer.js b/src/polyfills/typedarray-to-buffer.js index 1ff9cdbf9..42ebefc04 100644 --- a/src/polyfills/typedarray-to-buffer.js +++ b/src/polyfills/typedarray-to-buffer.js @@ -7,7 +7,7 @@ import { Buffer } from 'buffer/'; export default function typedarrayToBuffer(arr) { if (isTypedArray.strict(arr)) { - var buf = Buffer.from(arr.buffer); + let buf = Buffer.from(arr.buffer); if (arr.byteLength !== arr.buffer.byteLength) { buf = buf.slice(arr.byteOffset, arr.byteOffset + arr.byteLength); }