Require let or const instead of var

Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
This commit is contained in:
Rūdolfs Ošiņš
2022-08-30 12:09:27 +02:00
committed by Alexis Sellier
parent 853ed5c053
commit 795d6c43f8
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -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
+1 -1
View File
@@ -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);
}