Skip to content

Commit 9116270

Browse files
authored
chore(repo): add CI, pre-commit hooks, and lint cleanup (#3)
* chore(repo): add CI workflow and pre-commit hooks - GitHub Actions CI: lint, type check, registry build, full build on PRs - Husky pre-commit: lint staged files + type check - Add husky and lint-staged dev dependencies * chore(lint): fix eslint config and clean up lint errors - Migrate lint script from deprecated next lint to eslint CLI - Ignore .next/ and next-env.d.ts generated files - Remove unused CopyButton in json-viewer - Remove unused isCrypto in tip-jar tabs variant * fix(ci): specify packageManager for pnpm/action-setup --------- Co-authored-by: Justin Levine <20596508+justinlevinedotme@users.noreply.github.com>
1 parent a7f8b25 commit 9116270

7 files changed

Lines changed: 236 additions & 39 deletions

File tree

.github/workflows/ci.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
push:
7+
branches: [main]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
quality:
15+
name: Quality
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- uses: pnpm/action-setup@v4
21+
22+
- uses: actions/setup-node@v4
23+
with:
24+
node-version: 20
25+
cache: pnpm
26+
27+
- run: pnpm install --frozen-lockfile
28+
29+
- name: Lint
30+
run: pnpm lint
31+
32+
- name: Type check
33+
run: pnpm exec tsc --noEmit
34+
35+
- name: Registry build
36+
run: pnpm registry:build
37+
38+
- name: Build
39+
run: pnpm build

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pnpm exec lint-staged && pnpm exec tsc --noEmit

eslint.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const compat = new FlatCompat({
1010
});
1111

1212
const eslintConfig = [
13+
{ ignores: [".next/", "next-env.d.ts"] },
1314
...compat.extends("next/core-web-vitals", "next/typescript"),
1415
];
1516

package.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22
"name": "jalco-ui",
33
"version": "0.1.0",
44
"private": true,
5+
"packageManager": "pnpm@10.30.3",
56
"scripts": {
67
"dev": "tsx scripts/generate-preview-imports.ts && next dev",
78
"build": "shadcn build && tsx scripts/generate-preview-imports.ts && next build",
89
"start": "next start",
9-
"lint": "next lint",
10+
"lint": "eslint .",
1011
"registry:build": "shadcn build",
11-
"previews:generate": "tsx scripts/generate-preview-imports.ts"
12+
"previews:generate": "tsx scripts/generate-preview-imports.ts",
13+
"prepare": "husky"
1214
},
1315
"dependencies": {
1416
"@radix-ui/react-label": "^2.1.7",
@@ -39,10 +41,15 @@
3941
"eslint": "^9.32.0",
4042
"eslint-config-next": "15.3.1",
4143
"html-to-image": "^1.11.13",
44+
"husky": "^9.1.7",
45+
"lint-staged": "^16.3.3",
4246
"tailwindcss": "^4.1.11",
4347
"tsx": "^4.21.0",
4448
"typescript": "^5.9.2"
4549
},
50+
"lint-staged": {
51+
"*.{ts,tsx}": "eslint --max-warnings 0"
52+
},
4653
"pnpm": {
4754
"overrides": {
4855
"@types/react": "19.1.2",

0 commit comments

Comments
 (0)