Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add PR Prettier Check workflow #106

Merged
merged 2 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: PR Prettier Check

on:
pull_request:
branches:
- main

permissions:
pull-requests: read

jobs:
########### LINT PACKAGE ############
lint-package:
name: Lint Package
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: PNPM Install
uses: pnpm/action-setup@v4
with:
version: 9.1.3

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20.10.0
cache: 'pnpm'
registry-url: https://registry.npmjs.org/

- run: corepack enable

- name: Install NPM Dependencies
run: pnpm install --frozen-lockfile

- name: Prettier Check
if: ${{ always() }}
run: pnpm fmt.check
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
],
"scripts": {
"prepare": "husky install",
"fmt": "prettier --write src",
"fmt.check": "prettier --check src",
"format": "pretty-quick",
"dev": "microbundle watch --no-sourcemap --compress=false",
"build": "rimraf lib && microbundle --no-sourcemap --compress=false",
Expand Down Expand Up @@ -51,6 +53,7 @@
"husky": "^8.0.3",
"microbundle": "^0.15.1",
"mime-types": "^2.1.35",
"prettier": "3.3.3",
"pretty-quick": "^4.0.0",
"rimraf": "^6.0.1",
"vite": "^5.4.3"
Expand Down
Loading