-
-
Notifications
You must be signed in to change notification settings - Fork 28
45 lines (37 loc) · 1.04 KB
/
lint-and-format.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Lint and Format Code Base
on:
pull_request:
paths:
- 'src/**/*.js'
jobs:
lint_and_format:
name: runner / eslint and prettier
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0 # Important to fetch all history for diff
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install dependencies
run: npm install
- name: Run ESLint with reviewdog
uses: reviewdog/action-eslint@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-review
eslint_flags: 'src'
filter_mode: 'diff_context'
- name: Run Prettier with reviewdog
uses: EPMatt/reviewdog-action-prettier@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-review
prettier_flags: '--check src/**/*.js'
filter_mode: 'diff_context'