Skip to content
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

Add git init and precommit hook for eslint #47

Merged
merged 3 commits into from
Oct 13, 2017

Conversation

ceejtron
Copy link
Contributor

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.

@italopessoa
Copy link
Member

Well done @ceejtron. Seems that is everything ok. Let's wait for the reviewers. Thank you for your contribution ❤️

@@ -22,7 +22,18 @@ const func = (cwd, folderName) => {
}

const addEslintFileSuccess = (cwd, folderName) => {
const command = `npm i eslint eslint-config-airbnb babel-eslint --save-dev`
const eslintDependencies = [
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice Refactor mate

Copy link
Contributor

@jouderianjr jouderianjr left a comment

Choose a reason for hiding this comment

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

Hey, nice work! I'm pretty happy to see a new hook 💃

stdio:'inherit',
}

return spawn(command, [], terminalOpts)
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

@paulonotz0r
Copy link
Contributor

Nice, @ceejtron! This is really cool!

In addition, can you add commit lint too? You can use the same as used on ifactory-solutions/inside-client#8.

Thank you for the contribution.

@ceejtron
Copy link
Contributor Author

Added a check for .git as well as a commitlint hook

Copy link
Contributor

@paulonotz0r paulonotz0r left a comment

Choose a reason for hiding this comment

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

Great!

Copy link
Contributor

@jouderianjr jouderianjr left a comment

Choose a reason for hiding this comment

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

Just 2 minor things, then you will merge it! 💃

console.log('\n\n')
return Promise.resolve(true)
}
else {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please use else in the same line? 😄


return spawn(command, [], terminalOpts)
})
.then(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

You can do that as one line
.then(() => loadPackageJsonFromPath(${cwd}/${folderName}/package.json))

@ceejtron
Copy link
Contributor Author

ceejtron commented Oct 13, 2017

@jouderianjr I pushed the changes you asked for

@jouderianjr jouderianjr merged commit 1281883 into ifactory-solutions:master Oct 13, 2017
@jouderianjr
Copy link
Contributor

Awesome @ceejtron thanks for your work 💃

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

Successfully merging this pull request may close these issues.

4 participants