I’m learning. I know very little. My questions might sound stupid.
I’m taking a javascript tutorial. I’ve created an HTML file using VS Code which has js code in it. There is a problem with the js. I think it’s a syntax problem. I don’t know how to use VS Code to check syntax. In searching trying to learn how to check syntax, I found references suggesting ESLint as a plug-in to VS Code that would help with syntax checking. Accepting that ESLint is a needed tool, I decided to add ESLint plug-in to VS Code. Here is where I stalled out and got stuck. I cannot get ESLint to work.
From what I’ve read, I needed to install node.js. I downloaded and installed it. I’m not sure why; I was just following instructions in an article. At any rate, node.js is installed and I can load it.
Searching further, I found a YT saying that to install ESLint, I needed to run npm. I saw instructions saying to enter ‘$npm init -y’ in the Terminal window of VS Code (which I invoked using ctl+shift+m and choosing the Terminal tab). I found a prompt showing the path to my VS Code file. When I entered $npm init -y I got an error message.
Obviously, I need to know more than I do. Can anyone help?
First, do I need ESLint to check js syntax more easily? If not, is there another tool or do I just have to struggle with the native VS Code color coding? Syntax is not my strong suit; so any help the editor can give me is welcome.
Next, if ESLint is a good plug-in for js (for syntax checking and other uses), how do I get it installed and working? What does node.js have to do with it? Are there other apps or plug-ins I need? Everything I’ve found searching seems to expect me to know more than I do.