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); }