Use Circle CI to run lint, prettier, flow, and tests
Brian Vaughn committed
Apr 12, 2019 at 09:17 UTC
be930d549041fe88da22ee897d9ff99501a84fcd
3 files changed
+43
-2
.circleci/config.yml
new
+39
@@ -0,0 +1,39 @@
1
+# Javascript Node CircleCI 2.0 configuration file
2
+#
3
+# Check https://circleci.com/docs/2.0/language-javascript/ for more details
4
+#
5
+version: 2
6
+jobs:
7
+ build:
8
+ docker:
9
+ # specify the version you desire here
10
+ - image: circleci/node:7.10
11
+
12
+ # Specify service dependencies here if necessary
13
+ # CircleCI maintains a library of pre-built images
14
+ # documented at https://circleci.com/docs/2.0/circleci-images/
15
+ # - image: circleci/mongo:3.4.4
16
+
17
+ working_directory: ~/repo
18
+
19
+ steps:
20
+ - checkout
21
+
22
+ # Download and cache dependencies
23
+ - restore_cache:
24
+ keys:
25
+ - v1-dependencies-{{ checksum "package.json" }}
26
+ # fallback to using the latest cache if no exact match is found
27
+ - v1-dependencies-
28
+
29
+ - run: yarn install
30
+
31
+ - save_cache:
32
+ paths:
33
+ - node_modules
34
+ key: v1-dependencies-{{ checksum "package.json" }}
35
+
36
+ - run: yarn prettier:ci
37
+ - run: yarn lint:ci
38
+ - run: yarn flow
39
+ - run: yarn test
\ No newline at end of file
package.json
+3
-1
@@ -40,8 +40,10 @@
40
"deploy:firefox": "node ./shells/browser/firefox/deploy",
41
"linc": "lint-staged",
42
"lint": "eslint '**/*.js'",
43
+ "lint:ci": "eslint '**/*.js' --max-warnings 0",
44
"precommit": "lint-staged",
45
"prettier": "prettier --write '**/*.{js,json,css}'",
46
+ "prettier:ci": "prettier --check '**/*.{js,json,css}'",
47
"start": "cd ./shells/dev && opener ./index.html && webpack --config webpack.config.js --watch",
48
"test": "jest",
49
"test-debug": "node --inspect-brk node_modules/.bin/jest --runInBand",
@@ -117,7 +119,7 @@
119
"nullthrows": "^1.0.0",
120
"object-assign": "4.0.1",
121
"opener": "^1.5.1",
120
- "prettier": "^1.16.1",
122
+ "prettier": "^1.16.4",
123
"prop-types": "^15.6.2",
124
"react": "^16.9.0-alpha.0",
125
"react-color": "^2.11.7",
yarn.lock
+1
-1
@@ -8730,7 +8730,7 @@ preserve@^0.2.0:
8730
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"
8731
integrity sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=
8732
8733
-prettier@^1.16.1:
8733
+prettier@^1.16.4:
8734
version "1.16.4"
8735
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.16.4.tgz#73e37e73e018ad2db9c76742e2647e21790c9717"
8736
integrity sha512-ZzWuos7TI5CKUeQAtFd6Zhm2s6EpAD/ZLApIhsF9pRvRtM1RFo61dM/4MSRUA0SuLugA/zgrZD8m0BaY46Og7g==