Skip to content

Commit

Permalink
fix: add precommit hooks (#11)
Browse files Browse the repository at this point in the history
* fix: add precommit hooks

Add precommit hooks with Husky and lint-staged
We will run eslint and prettier for each files that is committed.
  • Loading branch information
ardeois authored Apr 3, 2020
1 parent 0442d45 commit 1228143
Show file tree
Hide file tree
Showing 6 changed files with 433 additions and 25 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: lint

on: [push]

jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 15

steps:
- uses: actions/checkout@v1
- uses: docker://borales/yarn:latest
with:
args: 'install'
- name: lint
uses: docker://borales/yarn:latest
with:
args: 'lint'
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ jobs:
- name: test
uses: docker://borales/yarn:latest
with:
cmd: 'test'
args: 'test'
32 changes: 14 additions & 18 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@

# v0.1.3 (Tue Nov 26 2019)

#### 🐛 Bug Fix
#### 🐛 Bug Fix

- fix: add __typename property [#6](https://github.com/ardeois/graphql-codegen-typescript-mock-data/pull/6) ([@ardeois](https://github.com/ardeois))
- fix: add \_\_typename property [#6](https://github.com/ardeois/graphql-codegen-typescript-mock-data/pull/6) ([@ardeois](https://github.com/ardeois))

#### Authors: 1

Expand All @@ -36,7 +36,7 @@

# v0.1.2 (Thu Nov 14 2019)

#### 🐛 Bug Fix
#### 🐛 Bug Fix

- fix: handle input-object-type definitions [#5](https://github.com/ardeois/graphql-codegen-typescript-mock-data/pull/5) ([@YevheniiMelikov](https://github.com/YevheniiMelikov))

Expand All @@ -48,7 +48,7 @@

# v0.1.1 (Tue Oct 29 2019)

#### 🐛 Bug Fix
#### 🐛 Bug Fix

- fix: move graphql to peer dependencies [#4](https://github.com/ardeois/graphql-codegen-typescript-mock-data/pull/4) ([@ardeois](https://github.com/ardeois))

Expand All @@ -60,7 +60,7 @@

# v0.1.0 (Tue Oct 29 2019)

#### 🚀 Enhancement
#### 🚀 Enhancement

- build: first release [#3](https://github.com/ardeois/graphql-codegen-typescript-mock-data/pull/3) ([@ardeois](https://github.com/ardeois))

Expand All @@ -72,32 +72,28 @@

# v0.0.5 (Tue Oct 29 2019)



---

# v0.0.4 (Tue Oct 29 2019)



---

# v0.0.3 (Tue Oct 29 2019)

#### 🐛 Bug Fix
#### 🐛 Bug Fix

- chore: setup build with publishing scripts [#1](https://github.com/ardeois/graphql-codegen-typescript-mock-data/pull/1) ([email protected])

#### ⚠️ Pushed to master
#### ⚠️ Pushed to master

- build: first release ([email protected])
- chore: update circleci build ([email protected])
- docs: update readme ([email protected])
- fix: typo in mockk generator ([email protected])
- fix: use casual instead of faker ([email protected])
- feat: use spread operator instead of mock builder ([email protected])
- build: first release ([email protected])
- chore: update circleci build ([email protected])
- docs: update readme ([email protected])
- fix: typo in mockk generator ([email protected])
- fix: use casual instead of faker ([email protected])
- feat: use spread operator instead of mock builder ([email protected])

#### Authors: 2

- Corentin Ardeois ([email protected])
- Corentin Ardeois ([email protected])
- Corentin Ardeois ([email protected])
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,22 @@ const user = aUser({ login: 'johndoe' });

// will create a user object with `login` property overridden to `johndoe`
```

### Contributing

Feel free to open issues and pull requests. We're always welcome support from the community.

To run this project locally:

- Use Node >= 10
- Make sure that you have the latest Yarn version (https://yarnpkg.com/lang/en/docs/install/)
- Clone this repo using `git clone`
- Run `yarn`
- Run `yarn build` to build the package
- Run `yarn test` to make sure everything works

### License

[![GitHub license](https://img.shields.io/badge/license-MIT-lightgrey.svg?maxAge=2592000)](https://raw.githubusercontent.com/apollostack/apollo-ios/master/LICENSE)

MIT
18 changes: 17 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@
"eslint-plugin-prettier": "^3.1.2",
"graphql": "^14.0.0",
"graphql-toolkit": "^0.7.5",
"husky": "^4.2.3",
"jest": "^25.2.7",
"lint-staged": "^10.1.1",
"prettier": "^2.0.2",
"prettier-config-landr": "^0.0.7",
"ts-jest": "^25.3.1",
Expand All @@ -56,13 +58,27 @@
"build": "tsc -m esnext --outDir dist/esnext && tsc -m commonjs --outDir dist/commonjs",
"test": "jest",
"lint": "eslint 'src/**/*.{js,ts,tsx}' --quiet --fix && tsc --noEmit",
"prettify": "prettier --config ./.prettierrc.js --write",
"auto:version": "yarn version --`auto version` --message 'Bump version to: %s [skip ci]'",
"auto:publish": "yarn publish && git push --follow-tags --set-upstream origin $CIRCLE_BRANCH",
"release": "auto changelog && yarn auto:version && yarn auto:publish && auto release"
},
"lint-staged": {
"*.{js,ts,tsx}": [
"eslint --quiet --fix"
],
"*.{json,md,html}": [
"prettier --write"
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"files": [
"dist/**/*",
"LICENCE",
"LICENSE",
"README.md"
]
}
Loading

0 comments on commit 1228143

Please sign in to comment.