Ir al contenido principal

Entradas

Mostrando las entradas etiquetadas como npm

Tests coverage in Typescript

Learn how to apply test coverage to your Typescripts projects.

Linting and formatting in Typescript

Linting and formatting tools are common in the Javascript/Typescript (JS/TS) scene, and their benefits are out of discussion: linters allows applying a set of coding style rules, whereas formatters apply a set of not coding but format style rules. Used in a development team scenario, its usage allows unifying the codebase by applying a common set of coding and formatting rules, no matter who the coder was. However, if not properly configured, these tools can collide in their functions, being the most common case the linter formatting code, a task that might be performed by the formatter. This article exposes the way of proceeding in order to allow both tools living in armony. Install and configure a linter The most common linter in the JS/TS scene is ESLint since TSLint , in the moment of writing this article, has been deprecated in favour of the first one. To install ESLint run these commands: $ npm install eslint --save-dev $ npx eslint --init Once installed you c...

Update NPM to the latest version (in a nutshell)

To update npm itself to its latest version, run the command: npm install -g npm@latest If working on Linux/Mac, chances are that you need superuser rights, so prefix the above command with sudo : sudo npm install -g npm@latest Finally, to check the version before and after updating, run the command npm -v