-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
47 lines (38 loc) · 1.08 KB
/
lint_vue.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
46
47
name: Javascript linting
on:
pull_request:
types: [opened, synchronize, reopened]
env:
node-version: 18
concurrency:
group: Lint js ${{ github.ref }}
cancel-in-progress: true
jobs:
eslint:
runs-on: ubuntu-latest
name: Lint vue and js files
strategy:
fail-fast: false
steps:
- name: Checkout sources
uses: actions/checkout@v4
# Yarn
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.node-version }}
cache: yarn
- name: Install yarn dependencies
run: yarn install --immutable
- name: Run eslint
run: yarn run lint --fix
- name: Run prettier
run: yarn run format
- name: Check if there is any file update needed
run: |
status=$(git status --porcelain)
if [ -n "$status" ]; then
echo -e "Waiting modifications:\n$status"
echo "::error::Eslint and prettier found fixes. Please run 'yarn run lint' and 'yarn run format' prior to your next commit."
exit -1
fi