Skip to content

Commit

Permalink
Setup prettier and CircleCI (#512)
Browse files Browse the repository at this point in the history
  • Loading branch information
jozan authored and vonovak committed Sep 10, 2018
1 parent e2f14dc commit 1daceee
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 4 deletions.
46 changes: 46 additions & 0 deletions .circleci/config.yml
@@ -0,0 +1,46 @@
version: 2
executorType: docker

defaults: &defaults
working_directory: ~/project
docker:
- image: 'circleci/node:10'

jobs:
build:
<<: *defaults
steps:
- checkout
- restore_cache:
keys:
- 'v1-yarn-{{ .Branch }}-{{ checksum "yarn.lock" }}'
- v1-yarn
- run: yarn
- save_cache:
key: v1-yarn
paths:
- node_modules/
- save_cache:
key: 'v1-yarn-{{ .Branch }}-{{ checksum "yarn.lock" }}'
paths:
- node_modules/
- persist_to_workspace:
root: ~/project
paths:
- node_modules
prettier:
<<: *defaults
steps:
- checkout
- attach_workspace:
at: ~/project
- run: 'yarn run prettier:check'

workflows:
version: 2
build-and-check-prettier:
jobs:
- build
- prettier:
requires:
- build
1 change: 1 addition & 0 deletions .prettierignore
@@ -0,0 +1 @@
example/ios/Pods
13 changes: 9 additions & 4 deletions package.json
Expand Up @@ -14,7 +14,9 @@
"Andrei Calazans (@Andrei_Calazans)"
],
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"prettier:check": "prettier --list-different '**/*.js' '**/*.md'",
"prettier:write": "prettier --write '**/*.js' '**/*.md'"
},
"keywords": [
"react-component",
Expand All @@ -36,9 +38,9 @@
"url": "https://github.com/react-native-community/react-native-google-signin/issues"
},
"peerDependencies": {
"prop-types": "^15.5.10",
"react": ">=15.4.0 || ^16.0.0-alpha",
"react-native": ">=0.40",
"prop-types": "^15.5.10"
"react-native": ">=0.40"
},
"rnpm": {
"ios": {
Expand All @@ -51,5 +53,8 @@
]
}
},
"license": "MIT"
"license": "MIT",
"devDependencies": {
"prettier": "1.14.2"
}
}
7 changes: 7 additions & 0 deletions yarn.lock
@@ -0,0 +1,7 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


prettier@^1.14.2:
version "1.14.2"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.14.2.tgz#0ac1c6e1a90baa22a62925f41963c841983282f9"

0 comments on commit 1daceee

Please sign in to comment.