chore: add a npm run check to make it easier to run all the web lint/fmt/etc locally

This commit is contained in:
Gabe Kangas
2026-02-04 13:42:19 -08:00
parent f03f7a43dc
commit 213ba5fd7e
3 changed files with 26 additions and 4 deletions
+1 -1
View File
@@ -50,6 +50,6 @@ jobs:
- name: golangci-lint - name: golangci-lint
uses: golangci/golangci-lint-action@v9 uses: golangci/golangci-lint-action@v9
with: with:
version: v2.5.0 version: v2.8.0
only-new-issues: true only-new-issues: true
args: --timeout=3m args: --timeout=3m
+15
View File
@@ -7,3 +7,18 @@ We abide by our [Code of Conduct](https://owncast.online/contribute/) and feel s
Weve been very lucky to have this so far, so maybe you can help us with your skills and passion, too! Weve been very lucky to have this so far, so maybe you can help us with your skills and passion, too!
There is a larger, more detailed, and more up-to-date [guide for helping contribute to Owncast on our website](https://owncast.online/help/). There is a larger, more detailed, and more up-to-date [guide for helping contribute to Owncast on our website](https://owncast.online/help/).
## Before Submitting a PR
For web changes, from the `web/` directory:
```bash
npm run check # Verify your code will pass CI
npm run lint && npm run format # Auto-fix errors
```
For Go changes, from the repository root:
```bash
make lint && make fmt
```
+10 -3
View File
@@ -9,13 +9,20 @@
"dev": "next dev", "dev": "next dev",
"build": "next build", "build": "next build",
"start": "next start", "start": "next start",
"lint": "eslint --fix --ext .js,.ts,.tsx types/ pages/ components/ stories/ && npm run stylelint", "check": "npm run check:lint && npm run check:format && npm run check:unused && npm test && npm run build",
"stylelint": "stylelint **/*.scss", "check:lint": "jsfiles=$(git diff --name-only origin/develop... | grep '^web/.*\\.[jt]sx\\?$' | sed 's|^web/||'); cssfiles=$(git diff --name-only origin/develop... | grep '^web/.*\\.s\\?css$' | sed 's|^web/||'); ([ -z \"$jsfiles\" ] || echo \"$jsfiles\" | xargs eslint) && ([ -z \"$cssfiles\" ] || echo \"$cssfiles\" | xargs stylelint)",
"check:format": "files=$(git diff --name-only origin/develop... | grep '^web/.*\\.\\(js\\|ts\\|jsx\\|tsx\\|css\\|scss\\)$' | sed 's|^web/||'); [ -z \"$files\" ] || echo \"$files\" | xargs prettier --check",
"check:unused": "knip --include dependencies,files,exports",
"lint": "eslint --fix --ext .js,.ts,.tsx types/ pages/ components/ && npm run stylelint",
"lint:changed": "files=$(git diff --name-only origin/develop... | grep '^web/.*\\.[jt]sx\\?$' | sed 's|^web/||'); [ -z \"$files\" ] || echo \"$files\" | xargs eslint --fix",
"stylelint": "stylelint --fix **/*.scss",
"stylelint:changed": "files=$(git diff --name-only origin/develop... | grep '^web/.*\\.s\\?css$' | sed 's|^web/||'); [ -z \"$files\" ] || echo \"$files\" | xargs stylelint --fix",
"storybook": "storybook dev -p 6006", "storybook": "storybook dev -p 6006",
"build-storybook": "storybook build", "build-storybook": "storybook build",
"build-styles": "cd ./style-definitions && style-dictionary build && ./build.sh && cd -", "build-styles": "cd ./style-definitions && style-dictionary build && ./build.sh && cd -",
"test": "jest", "test": "jest",
"format": "prettier --write **/*.{js,ts,jsx,tsx,css,md,scss}", "format": "prettier --write **/*.{js,ts,jsx,tsx,css,md,scss}",
"format:changed": "files=$(git diff --name-only origin/develop... | grep '^web/' | sed 's|^web/||'); [ -z \"$files\" ] || echo \"$files\" | xargs prettier --write",
"translate": "node scripts/i18n-extract.js" "translate": "node scripts/i18n-extract.js"
}, },
"dependencies": { "dependencies": {