Mayank0255 / Stackoverflow-Clone-Frontend

Clone project of a famous Q/A website for developers built using MySQL, Express, React, Node, Sequelize :globe_with_meridians:
https://stackoverflow-clone-client.vercel.app
MIT License
552 stars 211 forks source link

Configured Prettier and ESLint (Solves #51) #58

Closed joshi-kaushal closed 2 years ago

joshi-kaushal commented 2 years ago

Description

Configured the project with ESLint and Prettier. It solves issue #51.

How to validate

There are three scripts associated with this:

  1. npm run lint: checks the entire codebase and looks for linting issues.
  2. npm run lint:fix: fixes possible linting issues
  3. npm run format: checks the entire codebase and prettifies the code.

Things to know

You might receive an error while executing ESLint related issues on Windows systems but that's a problem with how NodeJS runs NPM scripts. It's working fine on WSL but not on Git Bash or Powershell. So it's really nothing to worry about.

This answer explains my point well: https://github.com/eslint/eslint/issues/7933#issuecomment-273269297 Also look at these:

joshi-kaushal commented 2 years ago

@Mayank0255 I was trying to add precommit hook using husky but the solutions I tried didn't work. Can you please check if you can do something at your end or provide good documentation?

Mayank0255 commented 2 years ago

@joshi-kaushal Thank you for the PR, but I think I will be putting the eslint config onhold for now as I will be doing it myself most probably as I have some requirements and based on future scope of this project, and eslint config might interrupt the building process. I hope you understand

51

joshi-kaushal commented 2 years ago

You should have updated the issue likewise or at least told me to stop working on it :)

Mayank0255 commented 2 years ago

@joshi-kaushal Actually that issue initially was assigned to me and there wasn't a label of hacktoberfest on it too, but after you asked I thought that you might do a good job but then I forgot that my code is following certain conventions already, among which most of them are violating the eslint default config, and this project had husky pre commit before but I removed that as it was causing issues while setting up so after you added husky too I decided to put it on hold.

I hope you understand.

github-actions[bot] commented 2 years ago

Stale pull request message