CI: Run prettier to check for JS code formatting

This commit is contained in:
Franz Liedke 2020-04-17 11:00:52 +02:00
parent 72ed4faa83
commit 899cdfda4e
No known key found for this signature in database
GPG Key ID: 9A0231A879B055F4
2 changed files with 33 additions and 1 deletions

31
.github/workflows/lint.yml vendored Normal file
View File

@ -0,0 +1,31 @@
name: Lint code
on:
push:
paths:
- 'js/src/**'
pull_request:
paths:
- 'js/src/**'
jobs:
prettier:
runs-on: ubuntu-latest
name: Lint JS code with Prettier
steps:
- uses: actions/checkout@master
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: "12"
- name: Install JS dependencies
run: npm ci
working-directory: ./js
- name: Check JS code for formatting
run: node_modules/.bin/prettier --check src
working-directory: ./js

View File

@ -26,7 +26,8 @@
"scripts": {
"dev": "webpack --mode development --watch",
"build": "webpack --mode production",
"format": "prettier --write src"
"format": "prettier --write src",
"format-check": "prettier --check src"
},
"husky": {
"hooks": {