195 return el;
196 };
197 } else {
198 autosize = function autosize2(el, options) {199 if (el) {
200 Array.prototype.forEach.call(el.length ? el : [el], function(x) {
201 return assign(x);
310 return this.close({ allowReconnect: false });
311 }
312 },
313 close(event) { 314 logger_default.log("WebSocket onclose event");
315 if (this.disconnected) {
316 return;
8719 return e2;
8720 }, l.update = function(e2) {
8721 return e2;
8722 }) : ((l = function(e2, t2) { 8723 return e2 && Array.prototype.forEach.call(e2.length ? e2 : [e2], function(e3) {
8724 return function(e4) {
8725 if (e4 && e4.nodeName && "TEXTAREA" === e4.nodeName && !n.has(e4)) {
9566 return setClassesFromString(el, value);
9567 }
9568 function setClassesFromString(el, classString) {
9569 let split = (classString2) => classString2.split(" ").filter(Boolean); 9570 let missingClasses = (classString2) => classString2.split(" ").filter((i2) => !el.classList.contains(i2)).filter(Boolean);
9571 let addClassesAndReturnUndo = (classes) => {
9572 el.classList.add(...classes);
9947 }
9948 function dontRegisterReactiveSideEffects(callback) {
9949 let cache2 = effect;
9950 overrideEffect((callback2, el) => { 9951 let storedEffect = cache2(callback2);
9952 release(storedEffect);
9953 return () => {
Found variables that are declared but not used anywhere.
NOTE: In browser applications, DeepSource recommends the use of ESModules over regular
text/javascript
scripts. Currently, we don't support variables that are not explicitly exported, and are injected into other scripts by being included in an HTML file
Unused variables are most often the result of incomplete refactoring. They can lead to confusing code and minor performance hitches.
NOTE: If you have intentionally left a variable unused, we suggest you to prefix the variable name with a _
to prevent them from being flagged by DeepSource.
// Write-only variables are not considered as used.
let y = 10;
y = 5;
// A variable that modifies only itself isn't considered used.
let z = 0;
z = z + 1;
// Unused argument
(function(x) {
return 5;
})();
// Unused recursive functions also raise this issue.
function fact(n) {
if (n < 2) return 1;
return n * fact(n - 1);
}
// When a function definition destructures an array,
// unused entries from the array also cause warnings.
function getY([x, y]) {
return y;
}
let x = 10;
alert(x);
((arg1) => {
return arg1;
})();
let myFunc;
myFunc = (n) => {
// this is legal
if (n < 0) myFunc();
};
// this is also considered legal
console.log(declaredLater);
var declaredLater;
// Only the second argument from the descructured array is used.
function getY([, y]) {
return y;
}