mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Install Prettier via package.json (#1170)
* Error if Prettier isn't already installed * Temporarily run Prettier check on every commit * Install and run Prettier via package.json * Trigger another prettier check on CI
This commit is contained in:
parent
1e8fa3ac7c
commit
3054e0f730
3 changed files with 45 additions and 7 deletions
13
.github/workflows/prettier.yml
vendored
13
.github/workflows/prettier.yml
vendored
|
|
@ -1,9 +1,6 @@
|
|||
name: Check JavaScript for conformance with Prettier
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'datasette/static/*'
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
prettier:
|
||||
|
|
@ -15,9 +12,11 @@ jobs:
|
|||
name: Configure npm caching
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-npm-${{ hashFiles('**/workflows/prettier.yml') }}
|
||||
key: ${{ runner.OS }}-npm-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-npm-
|
||||
${{ runner.OS }}-npm-
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: Run prettier
|
||||
run: |-
|
||||
npx prettier --check 'datasette/static/*[!.min].js'
|
||||
npx --no-install prettier --check 'datasette/static/*[!.min].js'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue