Add git init and precommit hook for eslint#47
Add git init and precommit hook for eslint#47jouderianjr merged 3 commits intoifactory-solutions:masterfrom
Conversation
|
Well done @ceejtron. Seems that is everything ok. Let's wait for the reviewers. Thank you for your contribution ❤️ |
|
|
||
| const addEslintFileSuccess = (cwd, folderName) => { | ||
| const command = `npm i eslint eslint-config-airbnb babel-eslint --save-dev` | ||
| const eslintDependencies = [ |
jouderianjr
left a comment
There was a problem hiding this comment.
Hey, nice work! I'm pretty happy to see a new hook 💃
| stdio:'inherit', | ||
| } | ||
|
|
||
| return spawn(command, [], terminalOpts) |
There was a problem hiding this comment.
So, We tried to find if has some issue on create-react-app related with that and I've found this PR facebook/create-react-app#1288
So, looks like that will be added at some moment, what do you think about test if already has a git started? maybe just test if exists .git folder.
|
Nice, @ceejtron! This is really cool! In addition, can you add Thank you for the contribution. |
|
Added a check for .git as well as a commitlint hook |
jouderianjr
left a comment
There was a problem hiding this comment.
Just 2 minor things, then you will merge it! 💃
| console.log('\n\n') | ||
| return Promise.resolve(true) | ||
| } | ||
| else { |
There was a problem hiding this comment.
Could you please use else in the same line? 😄
|
|
||
| return spawn(command, [], terminalOpts) | ||
| }) | ||
| .then(() => { |
There was a problem hiding this comment.
You can do that as one line
.then(() => loadPackageJsonFromPath(${cwd}/${folderName}/package.json))
|
@jouderianjr I pushed the changes you asked for |
|
Awesome @ceejtron thanks for your work 💃 |
As per #43 this adds precommit hooks for eslint. In addition, this adds a new question for initializing a git repository since precommit hooks can't be automatically set up unless a git repository has already been initialized.