Skip to content

Commit b22fbec

Browse files
authored
build: Add linting and build scripts (#2)
* build: Add linting and build scripts * Add empty source file * Add GH workflows * Update the pull request workflow to use the default ubuntu runner * Remove manual cache step from PR workflow * Update PR workflow name
1 parent 17c3617 commit b22fbec

9 files changed

Lines changed: 1037 additions & 55 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Check pull request health
2+
3+
on: pull_request
4+
5+
jobs:
6+
build-and-test:
7+
runs-on: ubuntu-latest
8+
timeout-minutes: 10
9+
steps:
10+
- name: Checkout repository
11+
uses: actions/checkout@v5
12+
13+
- name: Prepare Node.js environment
14+
uses: actions/setup-node@v6
15+
with:
16+
cache: npm
17+
node-version-file: .node-version
18+
19+
- name: Install project npm dependencies
20+
run: npm ci
21+
22+
- run: npm run check
23+
- run: npm run build
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Semantic Pull Request
2+
3+
on:
4+
pull_request:
5+
types:
6+
- edited
7+
- opened
8+
- synchronize
9+
10+
jobs:
11+
validate-title:
12+
name: Validate Title
13+
runs-on: ubuntu-latest
14+
15+
env:
16+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
timeout-minutes: 5
18+
steps:
19+
- name: Validate pull request title
20+
uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017
21+
with:
22+
validateSingleCommit: true

.github/workflows/ci.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx lint-staged

biome.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.3.11/schema.json",
3+
"vcs": {
4+
"enabled": true,
5+
"clientKind": "git",
6+
"useIgnoreFile": true
7+
},
8+
"files": {
9+
"includes": ["**", "!node_modules", "!dist", "!package.json", "!package-lock.json"]
10+
},
11+
"assist": { "actions": { "source": { "organizeImports": "on" } } },
12+
"linter": {
13+
"enabled": true,
14+
"rules": {
15+
"recommended": true
16+
}
17+
},
18+
"formatter": {
19+
"enabled": true,
20+
"attributePosition": "auto",
21+
"indentStyle": "space",
22+
"indentWidth": 4,
23+
"lineEnding": "lf",
24+
"lineWidth": 100
25+
},
26+
"javascript": {
27+
"formatter": {
28+
"arrowParentheses": "always",
29+
"bracketSameLine": false,
30+
"bracketSpacing": true,
31+
"jsxQuoteStyle": "double",
32+
"quoteProperties": "asNeeded",
33+
"quoteStyle": "single",
34+
"semicolons": "asNeeded",
35+
"trailingCommas": "all"
36+
}
37+
}
38+
}

0 commit comments

Comments
 (0)