Skip to content

Commit

Permalink
Setup action to lint TypeScript packages (#48)
Browse files Browse the repository at this point in the history
* setup action

* fix

* fix 2

* fix 3

* fix 4

* fix 5

* fix 6
  • Loading branch information
Pistonight authored Sep 26, 2023
1 parent b7d9f3d commit 3b25a1b
Show file tree
Hide file tree
Showing 60 changed files with 3,218 additions and 3,265 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Lint
on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
check:
name: Lint TypeScript Packages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: arduino/setup-task@v1
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-node@v3
with:
node-version: 18.x
- uses: dtolnay/rust-toolchain@stable
- uses: baptiste0928/cargo-install@v2
with:
crate: txtpp
features: cli
- run: task themes:ci client:ci docs:ci --output group
- run: task themes:check client:check docs:check --output group
38 changes: 31 additions & 7 deletions docs/Taskfile.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,46 @@
version: '3'

tasks:
txtpp:
desc: Preprocess source files
install:
cmds:
- npm install

ci:
cmds:
- echo "txtpp disabled for now"
- npm ci

dev:
desc: Start docs in watch mode
aliases: [d]
cmds:
- npm run dev
- npx vitepress dev src --port 3173 --host

build:
desc: Build docs assets
aliases: [b]
deps: [txtpp]
cmds:
- npm run build > /dev/null 2> /dev/null
- npx vitepress build src > /dev/null 2> /dev/null

check:
desc: Check for issues in the docs
cmds:
- txtpp verify src -r
- task: prettier
vars:
PRETTIER_ARGS: --check

fix:
desc: Fix issues in the docs
deps: [txtpp]
cmds:
- task: prettier
vars:
PRETTIER_ARGS: --write

txtpp:
desc: Preprocess source files
cmds:
- txtpp src -r

prettier:
cmds:
- npx prettier "./**/*.{ts,tsx,json,js,jsx,cjs,css,html}" {{.PRETTIER_ARGS}} --config ../web-client/.prettierrc.cjs
Loading

0 comments on commit 3b25a1b

Please sign in to comment.