Did you notice the errors? Extra semicolon., 'myApp' is assigned a value but never used. and such? These are generated from our new step lint:js as we are using the StandardJS JavaScript Standard Style linter to raise errors on things that do not conform to the rules.

a Linter performs static analysis, examines the code without running it, and returns errors for things that may cause issue (or bugs)

I can correct these errors in my src/ folder by removing the semicolons from app.js and sub-app.js, adding a new line at the end of app.js. I could also run standard --fix and StandardJS would attempt to fix issues that are pretty straightforward. I imagine most of the errors we started with will be fixed except for the 'mySubApp' is assigned a value but never used. errors.

To make this easier I will add --fix to the script we created previously so it will finally look like this:

lint:js Final

"lint:js": "standard src/**/*.js --fix"

Why StandardJS

I picked StandardJS as the style to use so there was less room for interpretation. If some one joins the project they will have to conform to the style or there will be issues with each change they make. This will help keep a specific coding standard throughout the project and since StandardJS is pretty set there shouldn’t be much time used debating each option that could be set in a more configurable linter.

Conclusion

Now that we have some coding standards to check things maybe we should add a test or at least the ability at add and run tests. Are there any other steps you would like to see? Let me know by leaving a comment below or sending an email to me at brett@wipdeveloper.com and let me know.