DPS909 Blog :Release 0.3 External Project Contribution
Tags: opensource, beginners
Published: 2022-11-17 20:37:11

Hey everyone, thanks for reading my Blog post. This post is regarding my contribution to External Project  [Qurl.gq](https://qurl.gq/).

## Overview 

[Qurl.gq](https://qurl.gq) is an open-source URL Shortener written in Node.js 🔗

## Screenshots

<a href="https://qurl.gq">
  <img height="400" alt="Homepage" src="https://user-images.githubusercontent.com/97064249/195446316-9442778e-7aa5-4c96-b051-202a58442881.png">
</a>

<a href="https://qurl.gq/glnh4/info">
  <img height="400" alt="Info Page" src="https://user-images.githubusercontent.com/97064249/195446416-aec6fdbb-4cb9-4500-babb-771c3818181d.png">
</a>

In Release 0.3 we were asked to keep working on larger projects to add more features or fix bugs.

## First External Pull Request 

For my contribution  in  an external project I have chosen [Qurl.gq](https://qurl.gq/).
The reason I chose this project is because
- I  really liked their idea about shortening the URl link.
- This project is build using Node.js

## My contribution 

I want to use my skill which I have learned in my course DPS909 Topics-in-open-source and contribute more into [Qurl.gq](https://qurl.gq/) 

So I have decided to include the `linter` into their project.
I have created the new issue Suggesting them to add the ​[ESLint](https://eslint.org/) into their current project.It will help them to  avoid certain code patterns that often lead to bugs.
And I have Create a simple "one-step" solution for running your linter on the entire project from the command line.
Furhtermore, I have added `Pre-commit and Pre-push` This is a pretty important step. This will ensure that before any developer commits any code, the changes made by him are validated with ESLint, and the code is properly formatted.

Developers tend to commit mistakes while coding. For example, you might forget to close a bracket or you might end up creating a variable that already exists. But, mistakes like this might end up breaking your app or site. We might push this buggy code to a cloud repository or it might take a considerable amount of time to resolve the issues caused due to such mistakes. If your code is being reviewed, it would consume your reviewer's time to find such sloppy mistakes or they might miss it completely.

- I have added [EsLint-Pre-Commit-Hook](https://www.npmjs.com/package/eslint-pre-commit-hook) 
- The pre-commit hook gets triggered at every time you run git commit before Git asks the developer for a commit message or generates a commit object.

## ESLint Git pre-commit hook
 I have used this [EsLint-Pre-Commit-Hook](https://www.npmjs.com/package/eslint-pre-commit-hook) 

To add into your current repo

  `npm i eslint-pre-commit-hook -D`

  or 

  `yarn add eslint-pre-commit-hook -D`

## Link to issue

[issue-33](https://github.com/TheRedstoneRadiant/Qurl.gq/issues/33)

## Additional note

I have Fixed all the error which was shown by the ESlint and make it error-free code.
From now on developers need to fix all the `ESlint` Errors otherwise they will not be able to commit their work on Git.
This will help to make  code maintenance easy.

## Outcome 
` npm run lint `


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iulgh7gtkz6waljettox.png)

When I commit my code to git using `git commit`, the pre- commit test is happening before commiting the file to git. If the test fails it will abort the git cmd with error messages.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/omp673v8b35tju80357l.png)




## Link to Pull request

   [PR](https://github.com/TheRedstoneRadiant/Qurl.gq/pull/35).


`Thanks`