Reflect on Coding Standards
At first, I double checked the link to follow “TypeScript coding standards” that appears in each particular assignment towards the top. Yes, this is another way of admitting, I have not taken the extra time to check this link before! Sometimes I am overconfident in my abilities. However, I am glad I clicked that link, and also a little surprised at its contents. It merely has a link to ESLint or the process of installing it, because it is saying ESLint is all you will need to follow the coding standards in this class. In other words, if ESLint is running and finding errors when it needs to, as long as it comes back without errors when you run it in the terminal for your project, then your project is likely ready to be turned in. I have found ESLint to be a very helpful feature in helping us format our codes correctly, because you can either examine each code individually and fix them one by one or simply run the ESLint fix line. This automatically fixes any detected errors. So far, ESLint fix has run successfully and fixed all of my errors each time, making this a very easy adjustment. I am slightly unsure how well I would be able to handle it without getting a DNF in a WOD if the fix command were to not work and I had to fix each error individually.
I also wanted to add, our original assignments in this course used TypeScript Playground, and there was no built in ESLint or similar feature to check your coding standards. But I am glad we have it now. I would like to discuss the other changes in switching to VSCode. This is related to coding standards, because if things like ESLint handling TypeScript coding standards, working with more files, configuration files, and HTML Boilerplate were not necessary, then VSCode wouldn’t be our first choice.
Like I already said, HTML Boilerplate is a useful tool when working with HTML files, usually starting with index.html. It provides everything necessary to have a working HTML page, all you have to do is change the title and add a script tag pointing to your designated javascript file. It took a while to understand that the javascript file comes from running tsc and its effect on the typescript file (due to the configuration files). I also keep forgetting to run install, for the npm packages. There is another issue. My “Live Preview” function seems to think I’m running a server, so it only gives me the server option. This creates a window for your HTML page within the VSCode window, and you are unable to do right-click and “inspect”. This obviously prevents me from viewing the console.log.
Aside from that, I am understanding now that creating code that passes coding standards enforced by extensions like ESLint is necessary in the demanding work environment. So like many other topics in this course, it is another one that I have enjoyed learning about and am feeling more comfortable about.