danielfloresd / team-profile-generator

Use const declarations for variables that are never reassigned JS-0242
Anti-pattern
Minor
6 occurrences in this check
'html' is never reassigned. Use 'const' instead
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
137        var file = new Blob([html], { type: 'text/html' });
'html' is never reassigned. Use 'const' instead
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();
126        win.document.write(html);
'team' is never reassigned. Use 'const' instead
  7import Intern from "../../lib/Intern.js"
  8
  9
 10let team = []; 11// Function to create manager card using jquery
 12const creteListItem = (employee) => {
 13    // Create a div with class card
'takenIDs' is never reassigned. Use 'const' instead
 10
 11// helper code
 12const generateHTML = require('./src/generateHTML');
 13let takenIDs = []; 14
 15const introQuestion = [
 16    {
'teamArray' is never reassigned. Use 'const' instead
300];
301
302// variables to hold created objects and document name
303let teamArray = [];304let documentName = '';
305
306const writeToFile = (documentName, documentBody) => {
'fileName' is never reassigned. Use 'const' instead
304let documentName = '';
305
306const writeToFile = (documentName, documentBody) => {
307    let fileName = "./dist/" + documentName;308    fs.writeFile(fileName, documentBody, (err) =>
309        err ? console.error(err) : console.log("HTML document successfully created at " + fileName));
310