Skip to content

Commit 7e97281

Browse files
authored
ci: add linting step to ci (#27)
Add individual package plus prettier linting. Also splits out the code checkout and dependency install steps closes #7
1 parent f7efb1a commit 7e97281

File tree

4 files changed

+113
-88
lines changed

4 files changed

+113
-88
lines changed

.circleci/config.yml

+43-9
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,29 @@
1-
defaults:
2-
docker: &docker
1+
defaults: &defaults
2+
docker:
33
- image: 'circleci/node:8-browsers'
4+
working_directory: ~/repo
5+
6+
repo_cache: &repo_cache
7+
key: v1-repo-{{ .Environment.CIRCLE_SHA1 }}
8+
9+
deps_cache: &deps_cache
10+
key: v1-dependencies-{{ checksum "yarn.lock" }}
411

512
version: 2
613
jobs:
7-
build:
8-
docker: *docker
9-
working_directory: ~/repo
10-
14+
checkout_code:
15+
<<: *defaults
1116
steps:
1217
- checkout
18+
- save_cache:
19+
<<: *repo_cache
20+
paths:
21+
- ~/repo
1322

23+
install_dependencies:
24+
<<: *defaults
25+
steps:
26+
- restore_cache: *repo_cache
1427
- restore_cache:
1528
keys:
1629
- v1-dependencies-{{ checksum "yarn.lock" }}
@@ -26,12 +39,33 @@ jobs:
2639
- packages/form/node_modules
2740
- packages/router/node_modules
2841
- packages/store/node_modules
29-
key: v1-dependencies-{{ checksum "yarn.lock" }}
30-
42+
<<: *deps_cache
43+
44+
lint:
45+
<<: *defaults
46+
steps:
47+
- restore_cache: *repo_cache
48+
- restore_cache: *deps_cache
49+
- run: yarn lint
50+
51+
build:
52+
<<: *defaults
53+
steps:
54+
- restore_cache: *repo_cache
55+
- restore_cache: *deps_cache
3156
- run: yarn build
3257

3358
workflows:
3459
version: 2
3560
build:
3661
jobs:
37-
- build
62+
- checkout_code
63+
- install_dependencies:
64+
requires:
65+
- checkout_code
66+
- lint:
67+
requires:
68+
- install_dependencies
69+
- build:
70+
requires:
71+
- install_dependencies

package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
],
66
"scripts": {
77
"build": "lerna run build",
8-
"lint": "lerna run lint",
8+
"lint": "npm-run-all -p lint:*",
9+
"lint:packages": "lerna run lint",
10+
"lint:prettier": "prettier -l \"**/*.*(ts|js|css|scss|json|md)\"",
911
"commit": "commit",
1012
"prettier": "prettier --write \"**/*.*(ts|js|css|scss|json|md)\"",
1113
"pre-commit": "lint-staged",
@@ -24,6 +26,7 @@
2426
"husky": "0.14.3",
2527
"lerna": "2.11.0",
2628
"lint-staged": "7.2.0",
29+
"npm-run-all": "4.1.3",
2730
"prettier": "1.13.7"
2831
}
2932
}

packages/router/README.md

-3
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,12 @@ For use with Angular 2-4: Use v6.
1818

1919
1. Use npm to install the bindings:
2020

21-
2221
```
2322
npm install @angular-redux/router --save
2423
```
2524

2625
2. Use the `routerReducer` when providing `Store`:
2726

28-
2927
```ts
3028
import { combineReducers } from 'redux';
3129
import { routerReducer } from '@angular-redux/router';
@@ -38,7 +36,6 @@ export default combineReducers<IAppState>({
3836

3937
3. Add the bindings to your root module.
4038

41-
4239
```ts
4340
import { NgModule } from '@angular/core';
4441
import { NgReduxModule, NgRedux } from '@angular-redux/core';

0 commit comments

Comments
 (0)