Skip to content

Commit 5bdb79d

Browse files
committed
chore: fix no-unused-vars warnings in converter, main, ui, visualization
1 parent ebdaa01 commit 5bdb79d

6 files changed

Lines changed: 6 additions & 22 deletions

File tree

src/js/converter.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,19 @@ export function initConverter() {
1919
}
2020

2121
let num = NaN;
22-
let type = "unknown";
2322

2423
// 1. Detección por prefijo
2524
if (rawVal.startsWith("0x") || rawVal.startsWith("0X")) {
2625
num = parseInt(rawVal.substring(2), 16);
27-
type = "hex";
2826
} else if (rawVal.startsWith("0b") || rawVal.startsWith("0B")) {
2927
num = parseInt(rawVal.substring(2), 2);
30-
type = "bin";
3128
}
3229
// 2. Detección por caracteres
3330
else if (/[a-fA-F]/.test(rawVal)) {
3431
num = parseInt(rawVal, 16);
35-
type = "hex";
3632
} else {
3733
// Asumir decimal por defecto
3834
num = parseInt(rawVal, 10);
39-
type = "dec";
4035
}
4136

4237
if (!isNaN(num)) {

src/js/main.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -434,12 +434,7 @@ function setupGlobalActions() {
434434

435435
// --- History System Integration ---
436436
// Create the panel and overlay (hidden by default)
437-
const {
438-
panel,
439-
overlay,
440-
toggleBtn: historyBtnIcon,
441-
content,
442-
} = createHistoryPanel(
437+
const { panel, overlay, content } = createHistoryPanel(
443438
// On Load Item
444439
item => {
445440
// Restore inputs
@@ -471,7 +466,7 @@ function setupGlobalActions() {
471466
content,
472467
getHistory(),
473468
getHistoryStats(),
474-
item => {
469+
() => {
475470
/* Load handled in createHistoryPanel closure above */
476471
},
477472
id => {

src/js/standard_calc.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
/**
22
* Módulo Calculadora Estándar IPv4 (Tailwind Version)
33
*/
4-
import { ipToDecimal, decimalToIP, prefixToMask } from "./converters.js";
4+
import { ipToDecimal, decimalToIP } from "./converters.js";
55
import { validateIPAddress, validateCIDRPrefix } from "./validators.js";
6-
import { showToast } from "./ui.js";
76

87
export function initStandardCalc(container) {
98
// 1. Render UI

src/js/theme.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export function initTheme() {
132132

133133
// Escuchar cambios en la preferencia del sistema
134134
if (window.matchMedia) {
135-
window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", e => {
135+
window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", () => {
136136
// Solo actualizar si el tema está en AUTO
137137
if (getCurrentTheme() === THEMES.AUTO) {
138138
applyTheme(THEMES.AUTO);

src/js/ui.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ if (!document.getElementById("toast-animations")) {
533533
* @param {Function} onClearHistory - Callback cuando se limpia el historial
534534
* @returns {Object} Panel y botón toggle
535535
*/
536-
export function createHistoryPanel(onLoadItem, onDeleteItem, onClearHistory) {
536+
export function createHistoryPanel() {
537537
// Crear overlay
538538
const overlay = document.createElement("div");
539539
overlay.className = "history-overlay";

src/js/visualization.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* @module visualization
55
*/
66

7-
import { ipToDecimal } from "./converters.js";
8-
97
/**
108
* Renderiza el gráfico de asignación de espacio de red
119
* @param {Array} subnets - Lista de subredes calculadas
@@ -24,16 +22,14 @@ export function renderAllocationChart(subnets, baseNetworkCIDR, container) {
2422
chartWrapper.appendChild(title);
2523

2624
// Calcular tamaño total de la red base
27-
const [baseIP, prefixStr] = baseNetworkCIDR.split("/");
25+
const [, prefixStr] = baseNetworkCIDR.split("/");
2826
const basePrefix = parseInt(prefixStr, 10);
2927
const totalIPs = Math.pow(2, 32 - basePrefix);
3028

3129
// Crear la barra de visualización
3230
const barContainer = document.createElement("div");
3331
barContainer.className = "allocation-bar";
3432

35-
let currentOffset = 0; // Para detectar huecos (espacio sin asignar)
36-
3733
subnets.forEach((subnet, index) => {
3834
// Calcular IPs de esta subred
3935
const subnetSize = Math.pow(2, 32 - subnet.prefix);
@@ -73,7 +69,6 @@ export function renderAllocationChart(subnets, baseNetworkCIDR, container) {
7369
});
7470

7571
barContainer.appendChild(segment);
76-
currentOffset += subnetSize;
7772
});
7873

7974
// Calcular espacio libre al final

0 commit comments

Comments
 (0)