Skip to content

Latest commit

 

History

History
69 lines (45 loc) · 1.99 KB

CONTRIBUTING.md

File metadata and controls

69 lines (45 loc) · 1.99 KB

Set up environment

Clone the source locally:

$ git clone https://github.com/phast184/link-checker-tool.git
$ cd link-checker-tool

Install project dependencies:

$ npm install
$ npm link

Formatting you code using prettier

$ npx prettier --write .

The command above allows us to format our code by using Prettier which is detailly documented at prettier documentation..

Avoiding silly mistake by using ESlint

$ npx eslint .

The command above allows to identify all silly mistakes in our app. Read more about esLint and its usage at ESLint documentation.

Automate ESLint and Prettier in VSCode

The automation of such tools like ESLint and Prettier in our editor makes a better workspace for our developer. Therefore, our code will be formatted automatically thanks to Prettier and we could fix any mistakes as soon as ESLint detects them.

  • Firstly, install Prettier and ESLint from VSCode extension

ESLint extension Prettier extension

  • At this step, ESLint will automatically work every time we code in VSCode

  • To auto-format after each save, we have to open command palette using Ctrl+Shift+P and choose Open Workspace Settings

Command Palette

  • In Formatting, choose Format on Save to allow Prettier auto-format our code after each save. onSave

Contribute to automated test units

How to run test

  • Currently, I'm using Jest to framework to manage my tests.

  • You can run test by using the command below.

$ npm run test

  • To contribute to the test library, please use the command below. This command will display how many functions which need to be tested.
$ npm run coverage

The test file is in "test/urlFunctions.test.js". Feel free to contribute. Much appreciation.