Skip to content

Commit 55d2690

Browse files
committed
added eslint action
1 parent 65e047e commit 55d2690

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

.github/workflows/ci.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,32 @@ jobs:
2424
- run: yarn test
2525
env:
2626
CI: true
27+
eslint:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v2
31+
- name: Setup Node
32+
uses: actions/setup-node@v2
33+
with:
34+
node-version: 17
35+
- name: Cache Yarn
36+
uses: actions/cache@v2
37+
with:
38+
path: '**/node_modules'
39+
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
40+
restore-keys: |
41+
${{ runner.os }}-yarn-
42+
- run: yarn install --frozen-lockfile
43+
- run: yarn lint-fix
44+
- name: Auto commit fixed code
45+
id: auto-commit-action
46+
uses: stefanzweifel/git-auto-commit-action@v4
47+
with:
48+
commit_message: Apply auto lint-fix changes
49+
branch: ${{ github.head_ref }}
50+
- name: eslint
51+
if: steps.auto-commit-action.outputs.changes_detected == 'false'
52+
uses: reviewdog/action-eslint@v1
53+
with:
54+
level: warning
55+
reporter: github-pr-review

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"build:main": "tsc -p tsconfig.main.json",
2525
"build:module": "tsc -p tsconfig.module.json",
2626
"lint": "eslint --ext .ts .",
27+
"lint-fix": "eslint --fix --ext .ts .",
2728
"generate": "run-p build:* && graphql-codegen",
2829
"prepublish": "run-p build:*"
2930
},

0 commit comments

Comments
 (0)