Skip to content

Commit f61cfa0

Browse files
committedSep 22, 2020
devops: add github workflow to check code style
1 parent 9ea1388 commit f61cfa0

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed
 

‎.github/workflows/code-style.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
name: Code Style,
3+
on: [push, pull_request],
4+
jobs:
5+
{
6+
lint:
7+
{
8+
name: Lint,
9+
runs-on: ubuntu-latest,
10+
steps:
11+
[
12+
{ uses: actions/checkout@v2 },
13+
{ uses: actions/setup-node@v1, with: { node-version: 14 } },
14+
{ run: yarn ci },
15+
{ run: yarn lint },
16+
],
17+
},
18+
format-check:
19+
{
20+
name: Format Check,
21+
runs-on: ubuntu-latest,
22+
steps:
23+
[
24+
{ uses: actions/checkout@v2 },
25+
{ uses: actions/setup-node@v1, with: { node-version: 14 } },
26+
{ run: yarn ci },
27+
{ run: yarn format-check },
28+
],
29+
},
30+
},
31+
}

‎.prettierignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
**/node_modules
2+
coverage
3+
.github/**/*.md

‎package.json

+2
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44
"license": "MIT",
55
"scripts": {
66
"bootstrap": "yarn && yarn fix-husky",
7+
"ci": "yarn install --frozen-lockfile",
78
"fix-husky": "ts-node ./scripts/fix-husky.ts",
89
"repair": "yarn --check-files && yarn fix-husky",
910
"list-packages": "yarn workspaces info && lerna ls",
1011
"ls": "yarn list-packages",
1112
"lint": "eslint .",
1213
"format": "prettier --write .",
14+
"format-check": "prettier --check .",
1315
"test": "jest"
1416
},
1517
"devDependencies": {

0 commit comments

Comments
 (0)
Please sign in to comment.