Skip to content
This repository has been archived by the owner on Mar 19, 2022. It is now read-only.

added prettier,husky and lint-staged. #71

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

rahulkhattri0
Copy link

@rahulkhattri0 rahulkhattri0 commented Nov 18, 2021

image

@rahulkhattri0 rahulkhattri0 mentioned this pull request Nov 18, 2021
package.json Outdated
@@ -28,7 +28,8 @@
"build": "npm run generate && react-scripts build",
"start:prod": "serve -s build",
"test": "react-scripts test",
"eject": "react-scripts eject"
"eject": "react-scripts eject",
"prepare": "husky install"
},
"eslintConfig": {
"extends": [
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is there this config in eslintConfig?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was using eslint before but because of some bug I had to remove that dependency. I'll remove eslintconfig from package.json.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed node modules and package-lock.json from my project directory. Then, I removed eslint from devDependencies and then ran npm install. I forgot to remove eslintconfig from package.json.

@rahulkhattri0
Copy link
Author

removed eslint config from package.json

Copy link

@gptkrsh gptkrsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove lint staged and just follow everything that is here

@rahulkhattri0
Copy link
Author

ok ill remove lint staged

@rahulkhattri0
Copy link
Author

rahulkhattri0 commented Nov 19, 2021

please tell me how to install "lint" package locally

@gptkrsh
Copy link

gptkrsh commented Nov 19, 2021

please tell me how to install "lint" package locally

it is a npm-script in package.json which basically runs eslint

@rahulkhattri0
Copy link
Author

should i just setup husky?

@rahulkhattri0
Copy link
Author

and you can run eslint using lint staged too

@gptkrsh
Copy link

gptkrsh commented Nov 19, 2021

should i just setup husky?

Yeah that would work too...

@rahulkhattri0
Copy link
Author

ok so ill just setup husky with a pre commit hook and the person who has been assigned to setup eslint can add lint.

#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think lint-staged is too late, we use the standard lint, please update.

Here is an example https://github.com/EddieHubCommunity/LinkFree/blob/main/.husky/pre-commit

Copy link

@naomi-lgbt naomi-lgbt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're almost there 🙂

Please take a look at Eddie's suggestions above.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants