GNOME-Nepal / website

Welcome to the official website of GNOME Nepal, crafted through the open-source contributions of our dedicated and talented developers.
https://nepal.gnome.org
MIT License
11 stars 45 forks source link

Add precommit hooks running eslint and prettier #71

Closed maskudo closed 2 weeks ago

maskudo commented 2 weeks ago

This PR aims to standardize and improve code quality by introducing pre-commit hooks for linting and formatting.

Problem Statement:

I noticed lots of unused variables, incorrect prop names. Similarly, prettier wasn't installed properly resulting in developer's default editor settings for formatting being applied. image image

Dependencies Added

netlify[bot] commented 2 weeks ago

Deploy request for gnomenepal rejected.

Name Link
Latest commit 1c669eb0b161bf1052deb87ff505558ee3cab309
utsavdotdev commented 2 weeks ago

@maskudo, Thanks for your contribution! Could you apply the suggested changes? After that, it’ll be good to go.

maskudo commented 2 weeks ago

I have applied the suggested changes. Furthermore, I have disabled the following rules:

{
    "react-refresh/only-export-components": "off",
    "react/prop-types": "off"
}

Notes

I have disabled eslint for the docusaurus directory because it uses a mix of commonjs and ecmascript modules which we dont have a clean way of resolving and trying to fix it doesnt feel worth the cost. We could probably have an eslint rule for the docusaurus page only inside its package.json if we need it in the future. I'm assuming we would simply be using typescript or jsdocs if we were serious about typing our props so we probably dont need the prop-types rules. The 'only export components' rule was previously set to warn which we dont really need. We export some hooks and constants along with some components which are good logical pairing that doesnt really make sense to split just for the sake of it.

utsavdotdev commented 2 weeks ago

Still logs message are not changed! no worries. Now it is good to go

utsavdotdev commented 2 weeks ago

Once again @maskudo , Thanks for your contribution