Development tools and linters

This is a description of the development tools and linters used in this part of the course.

In the first part we used the tools for the client development. We are now to use the same tools for server side development.

Install tools and linters

Tools and linters

Learn how to install these tools by reading the article "Development tools and linters" that you will find in the README.md in the repo "HTML CSS JavaScript dev tools".

Let the teacher know if you get any issues with the tools.

Extension for JavaScript as .cjs or .mjs or .js or even .ts?

Node.js was developed with a module system called CommonJS which uses require and module.exports. Some of the example programs in this course might still use this variant to work with modules.

Nowmore the ECMAScript module system with import end export has become the standard and Node.js has added support for it.

Node.js treats .cjs as CommonJS and .mjs files as ECMAScript modules. It treats .js files as whatever the default mode for the project is.

The default mode is CommonJS unless you edit the package.json to have a section like this to have ECMAScript modules as default.

The recommendation for the course is to add the above setting to the package.json and use .js extension to have ECMAScript modules.

By the way, if you see .ts it is TypeScript which is a strongly typed language that is transpiled to JavaScript. We will not use TypeScript in the course but it is possible to add a transpiler and work with TypeScript instead of JavaScript.

It is not recommended to use TypeScript, but here is still a short example on how to get going with a Hello World in TypeScript.

Be aware that you might need to do some changes into the configuration so assure that you always know that your linters are working.