Inspiration

We wanted to create an npm package that can easily be downloaded by anyone. Specifically, it should help in ordering the chaos that is always present in group projects - consistent syntax!

What it does

We created an npm package that sets up a pre-commit hook to lint your code before every commit. This can easily be configured by editing the created .hookconfig.js file. One of our hidden features also allows you to cause chaos by messing up you code

How we built it

we used javascript for our npm package. have our post-install create a pre-commit hook as well as necessary config files for prettier and eslint. We also created an additional .hookconfig.js that allows you to choose which linting tools you want to run. The pre-commit hooks then triggers before every commit, running the logic behind our npm package that initiates lint tools.

Challenges we ran into

  • Creating npm packages was simple, but having it modify files turns out to be complicated.
  • working with file systems means that you have to consider both windows and linux machines
  • figuring out the best way to run the different selected lint tools.
  • we wanted to add a flag on our commit message that tells the program to either cause or fix the chaos. Git does not support the adding of new flags, and reconfiguring that changes the whole purpose of our project. The other option was to check if the commit message contains the flag, but that also turned out to be complicated.
  • testing required us to constantly publish our npm package

Accomplishments that we're proud of

We managed to find a way to have our npm package be pretty modular. We have our pre-commit hook run a javascript file which reads the created config file. This means you can easily select which lint tools and checks you want to use, as long as we have made changes to support them.

What we learned

Things that may seem easy at first may be more complicated than it seems. Get the MVP first and adding features as they go.

What's next for PrePushPals

support more linting tools cause more chaos

Built With

Share this project:

Updates