Skip to content

Commit

Permalink
Merge pull request #23 from arcticicestudio/task/gh-18-husky
Browse files Browse the repository at this point in the history
Integrated Husky (1), the tool that make Git hooks easy and can prevent
bad Git commits, pushes and more 🐶 _woof_!

>> Configuration

The configuration file `.huskyrc.js` has been placed in the project root
and includes the commands to run for any supported Git hook (2). It will
at least contain configs for the following hooks:

- `pre-commit` - Run lint-staged (GH-17) before each commit (via
  `lint-staged` command) to ensure all staged files are compliant to all
  style guides.

References:

  (1)https://github.com/typicode/husky
  (2) https://github.com/typicode/husky/blob/master/DOCS.md#supported-hooks
  (3) https://github.com/typicode/husky/blob/master/DOCS.md#supported-hooks
  • Loading branch information
arcticicestudio authored Nov 17, 2018
2 parents 6ab1091 + 749e01f commit 16e90c3
Show file tree
Hide file tree
Showing 5 changed files with 176 additions and 31 deletions.
9 changes: 4 additions & 5 deletions .github/ISSUE_TEMPLATE/bugs.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ Describe the bug as in many relevant details as possible with a clear and concis

### Steps to Reproduce

1. Step One
2. Step Two
3. ...
1. Step One
2. Step Two
3. ...

### Expected Behavior

Expand All @@ -46,7 +46,6 @@ What actually happens?
Provide a [MCVE - The Minimal, Complete, and Verifiable Example](https://github.com/arcticicestudio/nord-docs/blob/develop/CONTRIBUTING.md#mcve)

**This is a optional section, but it can drastically increase the speed at which this issue can be processed since it takes away the time-consuming reconstruction to reproduce the bug.**

The recommended way is to upload it as [Gist](https://gist.github.com) or new repository to GitHub, but of course you can [attach it to this issue](https://help.github.com/articles/file-attachments-on-issues-and-pull-requests), use any free file hosting service or paste the code in [Markdown code blocks](https://help.github.com/articles/basic-writing-and-formatting-syntax) into this issue.

## Environment and Versions
Expand All @@ -69,7 +68,7 @@ Paste output of the command here.

## Stack Trace and Error Messages

```
```raw
Paste the full stack trace, error messages or the logfile here.
```

Expand Down
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/enhancement.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ If you've considered alternative features or solutions please describe it clearl
Provide a [MCVE - The Minimal, Complete, and Verifiable Example](https://github.com/arcticicestudio/nord-docs/blob/develop/CONTRIBUTING.md#mcve)

**This is a optional section, but it can drastically increase the speed at which this issue can be processed since it takes away the time-consuming reconstruction to reproduce the enhancement.**

The recommended way is to upload it as [Gist](https://gist.github.com) or new repository to GitHub, but of course you can [attach it to this issue](https://help.github.com/articles/file-attachments-on-issues-and-pull-requests), use any free file hosting service or paste the code in [Markdown code blocks](https://help.github.com/articles/basic-writing-and-formatting-syntax) into this issue.

## Additional Context
Expand Down
21 changes: 21 additions & 0 deletions .huskyrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright (C) 2018-present Arctic Ice Studio <[email protected]>
* Copyright (C) 2018-present Sven Greb <[email protected]>
*
* Project: Nord Docs
* Repository: https://github.com/arcticicestudio/nord-docs
* License: MIT
*/

/**
* @file The husky configuration.
* @author Arctic Ice Studio <[email protected]>
* @author Sven Greb <[email protected]>
* @see https://github.com/typicode/husky
*/

module.exports = {
hooks: {
"pre-commit": "lint-staged"
}
};
173 changes: 149 additions & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"format:fix": "eslint --fix --ext .js,.jsx .",
"format:pretty": "prettier --write \"./**/*.{js,json,jsx,md,mdx,yml}\"",
"lint:js": "eslint --ext .js,.jsx .",
"lint:md": "remark --no-stdout ."
"lint:md": "remark --no-stdout . \".github/**/*.md\""
},
"devDependencies": {
"babel-eslint": "10.0.1",
Expand All @@ -40,6 +40,7 @@
"eslint-plugin-jsx-a11y": "6.1.2",
"eslint-plugin-prettier": "3.0.0",
"eslint-plugin-react": "7.11.1",
"husky": "1.1.4",
"lint-staged": "8.0.5",
"prettier": "1.15.2",
"remark-cli": "6.0.1",
Expand Down

0 comments on commit 16e90c3

Please sign in to comment.