-
-
Notifications
You must be signed in to change notification settings - Fork 43
added prettier,husky and lint-staged. #71
base: main
Are you sure you want to change the base?
Conversation
rahulkhattri0
commented
Nov 18, 2021
•
edited by gitpod-io
bot
Loading
edited by gitpod-io
bot
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": [ |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
removed eslint config from package.json |
There was a problem hiding this 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
ok ill remove lint staged |
please tell me how to install "lint" package locally |
it is a npm-script in package.json which basically runs eslint |
should i just setup husky? |
and you can run eslint using lint staged too |
Yeah that would work too... |
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 |
There was a problem hiding this comment.
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
There was a problem hiding this 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.