danielfloresd / team-profile-generator

Consider using let or const instead of var JS-0239
Anti-pattern
Major
5 occurrences in this check
Unexpected var, use let or const instead
134        let html = generateHTML(team);
135        // Download generated html as a file
136        // Open window to download file to local machine
137        var file = new Blob([html], { type: 'text/html' });138        element.href = URL.createObjectURL(file);
139        element.download = "team.html";
140        element.click();
Unexpected var, use let or const instead
130    
131    $("#download").on("click", function () {
132        // Add download markdown as a file
133        var element = document.createElement("a");134        let html = generateHTML(team);
135        // Download generated html as a file
136        // Open window to download file to local machine
Unexpected var, use let or const instead
122        var element = document.createElement("a");
123        let html = generateHTML(team);
124        // Open a new window with the generated HTML
125        var win = window.open();126        win.document.write(html);
127        win.document.close();
128    });
Unexpected var, use let or const instead
119
120    $("#generate").on("click", function () {
121        // Add download markdown as a file
122        var element = document.createElement("a");123        let html = generateHTML(team);
124        // Open a new window with the generated HTML
125        var win = window.open();
Unexpected var, use let or const instead
 29
 30function generateDocument(data) {
 31
 32    var html = generateHTML(data); 33
 34    $("#html-preview").html(html);
 35    $("#preview-modal").modal("show");