- Project structure.
- Move files with Git.
- Our path…
We talked about the importance of using JSHint and @AirCrewMentor shared his usual .jshintsc configuration.
So at the root folder of every project the file
.jshintsc must be created to establish the styling rules.
I was using the package installed on sublime JSHint for it but AirCrewMentor said that it is better to use the Bash line command, so we used npm to install jshint and after that we were able to use the command
jshint lib/ or the desired folder to link.
make lint at the makefile
The importance to use the command, is because using an add-on in sublime is cool, but I need to get a good base on writing code on my own and if someday I go into an interview maybe I wont have sublime or my computer, but I would be able to use the bash.
2. Project Structure.
We talked a little bit about this in a previous session, but never got into it. This time AirCrewMentor wanted to start giving the proper structure to our code.
We can see the following typical structures:
- app/ (or lib/ or src/) depending on if it’s an app or actually a library.
- here goes all our files we are going to code ourselves.
- Usually the main file is called index.js and if this is the case, it is automatically collected.
- Here we would put all our pictures, html, css, js(vendor) that we are going to need for our code to run.
- Here is were we’ll put the final result of our JS code in a preferably single file (minified version)
- our files for test
- libraries installed.
- At this level we are going to have the following files:
3. Move files with Git.
Usually when a project is committed, we need to move and rename the files with git command, so it keeps the history of changes on the file. Otherwise it would appear like a file deleted and a new file without history.
$ git mv js/format_money.js lib/ # here we moved the file and renamed. $ git mv js/main.js lib/index.js
4. Our path…
Now I need to choose a personal project were I can find motivation and dedication, because before starting something more serious I need to get experience coding with sublime and iTerm.
I need to choose a project that keeps me up at nights
- Propose some projects that keep me up at nights
- Finish the NodeJS course
- Write the Wireframe for the tracking project AirCrewMentor proposed.