-
-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature : Add husky githook for checking linting error, format fix and typecheck #322
Comments
If this is valid issue please assign this to me : ) |
Please do check the corrent code of the website. There is actually some degree of eslint validation. |
Sure, Thank You : ) |
Currently the eslint config doesn't allow semicolons. We would want that. We didn't make the eslint config, and I haven't bothered to go check/fix it, or set up using prettier. I expect a number of the rules will be "blown away" when using prettier default rules. |
@Relequestual, could you please inform me about the types of files I should format using Prettier? I intend to format only .ts, .tsx, .js, and .jsx files. |
As far as i understand husky does adds a layer of friction to first time contributors, to have the linter run for every commit they do while working on the project, but in the long run this does helps us to have clean commits, I am not sure how much this would be relevant as of now for the project |
This will be highly relevant as our project is open source, and with the upcoming GSOC, we anticipate a flood of contributors. Setting up Husky with Prettier and ESLint will be beneficial and will lead to cleaner code. Different contributors write code in different styles, and Prettier will help in maintaining code quality and consistency throughout the project. Most open-source projects utilize these tools, so we are good to go. |
Thanks @aialok, The question here is more of about the friction-> we always have the option to run prettier and linter on our code manually once we are done with all our commits, and even if we somehow forget to not run it the CI should take care of it, but i understand your point as well to have cleaner commits upfront. Maybe @Relequestual or @benjagm can guide us more here |
Reason/Context:
Why we need this improvement?
We need this improvement to ensure consistent code quality and prevent common errors before they are committed to the repository. This will help in maintaining a clean and error-free codebase.
How will this change help?
This change will automate the process of checking for linting errors, formatting issues, and type checking before any commit is made. It will save time for developers and improve the overall quality of the codebase.
What is the motivation?
The motivation behind this change is to enforce coding standards, ensure consistency across the codebase, and catch potential errors early in the development process.
Description:
What changes have to be introduced?
We need to add Husky as a git hook manager and configure it to run linting, formatting, and type checking scripts before allowing commits. This involves adding necessary dependencies, configuring Husky in the
package.json
file, and defining the scripts to run.Will this be a breaking change?
This change should not be breaking unless there are significant conflicts with existing git hooks or if developers are not following linting, formatting, or type checking rules strictly.
How could it be implemented/designed?
Implementation involves the following steps:
package.json
file to trigger hooks on specific git events (e.g., pre-commit).package.json
file.Do you think this work might require an Architectural Decision Record (ADR)? (significant or noteworthy)
The text was updated successfully, but these errors were encountered: